#include <iostream>

using namespace std;

int josephus(int n, int k)
{
	if(n == 1)
	{
		return(0);
	}
	return((josephus(n - 1, k) + k) % n);
}

void solve()
{
	int n, k, m;
	while(cin >> n >> k >> m, n || k || m)
	{
		m = (m - k + 1 + n) % n;
		cout << (josephus(n, k) + m - 1 + n) % n + 1 << endl;
	}
}

int main()
{
	solve();
	return(0);
}