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

int joseph(vector<int> &v,int d,int initial){
	int c=initial;
	for(;v.size()>1;c=(c+d)%v.size()){
		v.erase(v.begin()+c);
		c--;
	}
	return v[0];
}

int main(){
	int n,k,m;
	for(;scanf("%d%d%d",&n,&k,&m),n;){
		vector<int>v(n);
		for(int i=0;i<n;i++)v[i]=i+1;
		printf("%d\n",joseph(v,k,m-1));
	}
}