#include<iostream>
using namespace std;
int J(int n,int k)
{
	if (n <= 1)return 0;
	return (J(n - 1, k) + k) % n;
}
int main()
{
	int n, k, m;
	while (cin >> n >> k >> m && n != 0 || k != 0 || m != 0)
	{
		long ans = (J(n - 1,k)+ m) % n + 1;
		cout << ans << endl;
	}
	return 0;
}