//Similar 0085
#include<stdio.h>

int main(){
  int n,k,m;    // n=element,k=kankaku,m=start
  int i,c,d;    // c=cnt,d=delete
  int a[10001]; // Data List

  for(;;){
    scanf("%d%d%d",&n,&k,&m);
    if(n==0&&k==0&&m==0)
      break;

    for(i=0;i<10001;i++)
      a[i]=0;

    a[m]++;  //First Delete
    d=1;
    i=m;     //index Start Set
    while(1){
      if(d==n-1)  //Fin Han
	break;
      else{
	c=0;
	while(1){
	  i++;
	  if(i>n) i=1; //Element OverFlow
	  if(a[i]==0)
	    c++;
	  if(c==k){  //Delete Execute
	    a[i]++;
	    d++;
	    break;
	  }
	}
      }
    }
    for(i=1;i<=n;i++){
      if(a[i]==0){
	printf("%d\n",i);
	break;
      }
    }
  }
  return 0;
}