#include <iostream>
using namespace std;

long long int kansu( long long int n, long long int k ) {

  long long int ans;

  if ( n == 1 ) {
    ans = 0;
  }else {
    ans = ( kansu( n - 1, k ) + k ) % ( n - 1 );
  }

  //  cout << "n = " << n << " : k = " << k << " : ans = " << ans << endl;
  return ans;

}

int main() {

  while( true ) {

    long long int n, k, m;
    cin >> n >> k >> m;
    if ( n == 0 ) break;

    cout << ( kansu( n, k ) + m ) % n + 1 << endl;

  }

  return 0;

}