#include <bits/stdc++.h>

using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define SORT(v) sort(ALL(v))
//#define scanf scanf_s
typedef pair<int, int> P;

bool ari[10005] = {};
int main()
{
	int n, k, m;
	while (cin >> n >> k >> m, n)
	{

		FOR(i, 1, n + 1) ari[i] = true;
		int cnt = n;
		int t = m;
		while (cnt > 1)
		{
			ari[m] = false;
			cnt--;
			int cnttmp = 0;

			for (int i = 0; cnttmp < (k%cnt ? k%cnt:k); i++)
			{
				m++;
				if (m == n + 1) m = 1;
				if (ari[m] == true) cnttmp++;
			}
		}

		REP(i, n + 1)
		{
			if (ari[i] == true) cout << i << endl;
		}

	}
	return 0;
}