And Then There was One Turkey Left (2011-ish)

Description

The U. of T. Engineering “Skule” — boo, hiss! — has a tradition at their big Thanksgiving bash. At the end of their potluck feast, they play a game — And Then There was One Turkey Left — to decide who gets to take all the leftovers home. This person gets named the last turkey. (Leftovers of dishes prepared by U. of T. engineering students?! Blech!)

The attendees of the U. of T. Engineering “Skule” — boo, hiss! — Thanksgiving bash all sit around on giant table. Consider them numbered 1,..., n clockwise. Two numbers are provided: k and m. From this, people are made to leave the table one by one by the following rules, until only one remains (the one turkey left).

  1. Make person m leave.
  2. Locate the k-th person clockwise from m and make him or her leave.
  3. In subsequent steps, start from the seat of the person removed in the last step, make k hops clockwise over the remaining people, and make the one you reach leave. In other words, skip (k - 1) remaining people clockwise, and remove the next one. Repeat this until only one person is left, and answer his or her number.

For example, the answer for the case n = 8 , k = 5 , m = 3 is 1, as shown.

Example


Input

The input consists of multiple datasets each of which is formatted as follows.

n k m

The last dataset is followed by a line containing three zeros. Numbers in a line are separated by a single space. A dataset satisfies the following conditions:

2 ≤ n ≤ 10,000
1 ≤ k ≤ 10,000
1 ≤ mn

The number of datasets is less than 100.


Output

For each dataset, output a line containing the number of the person left — the one turkey left! — in the final state. No extra characters such as spaces should appear in the output.


Sample Input

8 5 3 
100 9999 98 
10000 10000 10000 
0 0 0

Sample Output

1
93
2019