Roundgod is given a permutation

of length

(initially

) and

operations, each operation can be expressed as a pair
_%7B%7D)
, which means to do

Josephus transform for

times on permutation

. Print the final permutation in one line.

Josephus transform is that: firstly list the

integers in premutation

in a ring, then count

numbers from the first number, erase the result number from the ring and write it into the back of the new permutation

, then count

numbers from the next number and do the same things again, until all numbers are written into

, which is the result permutation after doing

Josephus transform for once on

. For example,

will become

if we do

Josephus transform for once on it.