#include <bits/stdc++.h>
#include <stdint.h>

typedef uint32_t u32;
typedef uint64_t u64;
typedef std::pair<int, int> pii;

int main() {

  for(;;) {
    int n, k, m;
    std::cin >> n >> k >> m;
    if( n == 0 and k == 0 and m == 0 ) break;

    long dp[20000];
    dp[1] = 0;
    for(int i = 2; i <= n; ++i) {
      dp[i] = (dp[i - 1] + k) % i;
    }
    std::cout << (dp[n] + m - k + 1000000 * (long)n) % n + 1 << std::endl;    
  }
  
  return 0;
}