#include<bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
typedef vector<int> VI;
typedef pair<int,int> P;

//-----------------------------------------------------------------------

signed main()
{   
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,d,a;
    while(cin>>n>>d>>a,n)
    {   
        VI v(n); 
        REP(i,n) v[i]=i+1;
        
        int pos=a-1;
        while(v.size()>1){
            v.erase(v.begin()+pos);
            pos=(pos+d-1)%v.size();
        }
        cout<<v[0]<<endl;
    }
}
