*n* children are standing in a circle and playing the counting-out game. Children are numbered clockwise from 1 to *n*. In the beginning, the first child is considered the leader. The game is played in *k* steps. In the *i*-th step the leader counts out *a*<sub class="lower-index">*i*</sub> people in clockwise order, starting from the next person. The last one to be pointed at by the leader is eliminated, and the next player after him becomes the new leader.

For example, if there are children with numbers [8, 10, 13, 14, 16] currently in the circle, the leader is child 13 and *a*<sub class="lower-index">*i*</sub> = 12, then counting-out rhyme ends on child 16, who is eliminated. Child 8 becomes the leader.

You have to write a program which prints the number of the child to be eliminated on every step.
The first line contains two integer numbers *n* and *k* (2 ≤ *n* ≤ 100, 1 ≤ *k* ≤ *n* - 1).

The next line contains *k* integer numbers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*k*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>).
Let's consider first example: 
 -  In the first step child 4 is eliminated, child 5 becomes the leader. -  In the second step child 2 is eliminated, child 3 becomes the leader. -  In the third step child 5 is eliminated, child 6 becomes the leader. -  In the fourth step child 6 is eliminated, child 7 becomes the leader. -  In the final step child 1 is eliminated, child 3 becomes the leader.
7 5
10 4 11 4 1
4 2 5 6 1 
3 2
2 5
3 2 
2 1
1
2 
2 1
2
1 
2 1
3
2 
10 7
5 10 4 3 8 10 6
6 8 3 9 2 4 10 
10 8
12 6 12 15 20 8 17 12
3 10 6 8 2 9 4 5 
12 10
76 58 82 54 97 46 17 40 36 15
5 9 12 1 3 10 8 11 2 4 
12 6
76 61 94 15 66 26
5 12 6 2 7 3 
90 10
1045 8705 6077 3282 1459 9809 383 6206 2674 7274
56 39 45 20 17 55 14 85 51 33 
100 30
601771 913885 829106 91674 465657 367068 142461 873149 294276 916519 720701 370006 551782 321506 68525 570684 81178 724855 564907 661130 10112 983124 799801 100639 766045 862312 513021 232094 979480 408554
72 89 16 26 85 73 29 99 63 30 8 46 70 19 100 93 36 54 65 77 17 79 62 64 21 69 42 82 68 1 
3 2
20148340 81473314
2 3 
3 2
301633543 643389490
2 3 
6 5
532623340 628883728 583960589 690950241 488468353
5 3 6 1 4 
6 2
458995521 294343587
4 1 
68 1
5
6 
n,k=map(int,input().split())
a=list(map(int,input().split()))
rem=[1]*n
tmp=0
ans=[]
for i in range(k):
  for _ in range(a[i]%(n-i)):
    tmp+=1
    tmp%=n
    while rem[tmp]==0:
      tmp+=1
      tmp%=n
  ans.append(tmp+1)
  rem[tmp]=0
  while rem[tmp]==0:
    tmp+=1
    tmp%=n
print(*ans)