#include<stdio.h>
int main(){
  int a,b,c,i,j;
  while(scanf("%d %d %d",&a,&b,&c),a){
    int d[10010]={};
    d[--c]=1;
    while(--a>1){//printf("%d\n",a);
      //for(i=0;i<8;i++)printf("%d ",d[i]);printf("\n");
      c=(c+b-1)%a;
      for(i=j=0;j<=c;j+=1-d[i++]);//printf("%d ",j+1-d[i]);printf(":%d %d\n",c,i);
      d[i-1]=1;
    }
    //for(i=0;i<8;i++)printf("%d ",d[i]);
    for(i=0;d[i];i++);
    printf("%d\n",i+1);
  }
  return 0;
}