#include <iostream>
#include <cstdio>
using namespace std;
int n,k,m;
//f(n + 1,n) = f(n,n - 1) - [(n - 1) - (k - 1)% n] % n
void solve(){	
	int res = 0;
	for(int i = 2;i < n;i ++){
		res = (res - ((i - 1) - (k - 1) % i + i)%i + i)% i; 
		
	}
	res =  (res + m) % n + 1;
	printf("%d\n",res);
}

int main(){
	while(scanf("%d%d%d",&n,&k,&m) && !(n == 0 && m == 0 && k == 0)){
		solve();
		
	}
	
}