#include<stdio.h>
#include<string.h>
int N,K,M,f[10005],n,i,j,p;
int main()
{
	for(;scanf("%d%d%d",&N,&K,&M),N;)
	{
		memset(f,0,sizeof(f));
		for(i=j=0,n=N-1;i<n;i++,j++)
		{
			if(i==M-1)
				j++;
			f[i]=j+1;
		}
		for(p=f[M-1]?M-1:0;n>1;n--)
		{
			for(i=1;i<K;i++)
				p=f[p+1]?p+1:0;
			memmove(f+p,f+p+1,4*(n-p));
			if(f[p]==0)
				p=0;
		}
		
		printf("%d\n",f[0]);
	}
	return 0;
}