loop do
    n, k, m = gets.split.map(&:to_i)
    break if n == 0 && k == 0 && m == 0
    a = Array.new(n)
    n.times do |i|
        a[i] = i + 1
    end
    m -= 1
    a.delete_at(m)
    while a.size > 1
        m = (m + k - 1) % a.size
        a.delete_at(m)
    end
    puts a[0]
end