#include <iostream>
#include <vector>
using namespace std;
int main(){
  int n, k, m;
  while(cin >> n >> k >> m, n){
    vector<int> V;
    for(int i = 0; i < n; ++i)
      V.push_back(i+1);
    --m;
    while(V.size() > 1){
      V.erase(V.begin()+m);
      m = (m+k-1)%(int)V.size();
    }
    cout << V[0] << endl;
  }
  return 0;
}