#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n, k, m;
	while (cin >> n >> k >> m, n || k || m) {
		vector<int> val(n);
		for (int i = 1; i <= n; i++) {
			val[i - 1] = i;
		}
		int now = m - 1;
		while (val.size() > 1) {
			val.erase(val.begin() + now);
			now = (now + k - 1) % val.size();
		}
		cout << val[0] << endl;
	}
	return 0;
}