#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  
  int n, k, m;
  while (cin >> n >> k >> m, n) {
    vector<int> stone(n);
    for (int i = 0; i < n; i++) {
      stone[i] = i + 1;
    }
    m--;
    while (stone.size() > 1) {
      stone.erase(stone.begin() + m);
      m = (m + k - 1) % stone.size();
    }
    cout << stone[0] << endl;
  }

  return 0;
}
