def solve(arr, n, k, pos)
  len = n
  while len != 1
    arr.slice!(pos)
    len -= 1
    pos = (pos + k - 1) % len
  end
  arr[0]
end

loop do
  n, k, m = gets.split.map(&:to_i)
  break if n == 0
  puts solve((1..n).to_a, n, k, m - 1)
end