#include <stdio.h>
#include <memory.h>
int main(void){
	int n,k,m,f[10000],i,t,c;
	while(1){
		scanf("%d %d %d",&n,&k,&m);
		if(!n){
			break;
		}
		memset(f,0,sizeof(f));
		i=m-1;
		t=n;
		while(1){
			f[i]=1;
			t--;
			if(t==1){
				break;
			}
			c=0;
			while(c<k){
				i=(i+1)%n;
				if(!f[i]){
					c++;
				}
			}
		}
		for(i=0;i<n;i++){
			if(!f[i]){
				printf("%d\n",i+1);
				break;
			}
		}
	}
	return 0;
}