Time limit
1s
Memory limit
128 MB
Dongho and his classmates went on a picnic. A total of N students take part in a counting-out game.
The N students sit in a circle clockwise, numbered from 1 to N. The game starts with student 1. Moving clockwise, the students count 1, 2, ... , K one by one. The student who says K leaves the circle. Counting then starts again from 1 with the next student still in the circle.
Dongho is student M. Given N, K, and M, determine the order in which Dongho leaves the circle.
The first line contains three integers N, K, and M.
1 <= N, M <= 5,000,000M <= N1 <= KPrint the order in which Dongho leaves the circle.
1 <= N, M <= 5,000,000M <= N1 <= K