#include <iostream>

using namespace std;


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

int main() {
  while (true) {
    int n, k, m;
    cin >> n >> k >> m;
    if (n + k + m == 0) {
      break;
    }

    m = (m - k + 1 + n) % n;
    cout << (josephus(n, k) + m - 1 + n) % n + 1 << endl;
  }

  return 0;
}