n, k, m = map(int, input().split())
dui = list(range(n))
while n > 1:
    k = (k + m - 1) % n
    dui.pop(k)
    n = n - 1
print(dui[0])