Fried Soboro Buns

Given how many buns were eaten, find which person picked up the last bun when person i grabs a bun at multiples of t_i, ties broken by smaller index.

Medium6Binary searchSortingMathNo attempts yetTime limit1sMemory limit512 MB

Problem

Yeongseon came back from Daejeon with nn fried soboro buns.

She left them in the club room to share with the members and stepped out for a moment. When she got back, ss buns were untouched. A bun that someone had picked up to eat does not count among those ss.

While Yeongseon was away, mm people were in the room, numbered 11 to mm. She eats with the members often, so she knows tit_i, the number of seconds person ii needs to eat one bun.

Everyone picks up a bun the moment Yeongseon leaves, at second 00, and picks up the next bun as soon as the one in hand is finished. So person ii picks up a bun at seconds 00, tit_i, 2ti2t_i, 3ti3t_i, and so on. When several people pick at the same moment, the person with the smaller number picks first.

Find the number of the person who picked up a bun last.

For example, suppose person 11 eats one bun in 11 second, person 22 in 33 seconds, person 33 in 55 seconds, and there are 10001000 buns.

  • If 11 bun is gone, person 11 picked up a first bun.
  • If 22 are gone, person 22 picked up a first bun right after person 11.
  • If 33 are gone, person 33 picked up a first bun right after person 22.
  • If 44 are gone, person 11 finished the bun in hand and picked up a second one.
  • If 55 are gone, person 11 picked up a third bun.
  • If 66 are gone, person 11 picked up a fourth bun.
  • If 77 are gone, person 22 finished the bun in hand and picked up a second one right after person 11.

Input

The first line contains nn and ss separated by a space. nn is the number of buns Yeongseon bought (1n1000001 \le n \le 100000), and ss is the number of untouched buns left when she returned (0sn10 \le s \le n-1).

The second line contains the number of people mm (1m1000001 \le m \le 100000). Each of the next mm lines contains tit_i, the number of seconds one person needs to eat one bun, given for person 11 through person mm in order (1ti10001 \le t_i \le 1000).

Output

Print the number of the person who picked up a bun last.