### main

loop do
  n, k, m = gets.split.map(&:to_i)
  break if (n | k | m) == 0
  #p [n, k, m]

  pos = m - 1
  sts = (1..n).to_a
  sts.delete_at(pos)

  while sts.length > 1
    pos = (pos + k - 1) % sts.length
    sts.delete_at(pos)
  end

  puts sts.first
end