#include <iostream>
#include <vector>
using namespace std;

int main() {

  while(1) {
    int n,k,m;
    cin >> n >> k >> m;
    if(n==0 && k==0 && m==0) break;

    vector <int> stn;
    for(int i=0;i<n;i++) stn.push_back(i+1);
    m--;
    int i=m;
    while(stn.size() != 1) {
      stn.erase(stn.begin()+i);
      i = (i+(k-1))%stn.size();
     }
    cout << stn[0] <<endl;
  }
  return 0 ;
}