#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int arr[1003];
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) arr[i] = i + 1;
  if (k >= 0) {
    int cur = m - 1;
    for (int i = 1; i <= k; i++) {
      cur++;
      if (cur == n) cur = 0;
    }
    cout << arr[cur] << endl;
  } else {
    int cur = m - 1;
    for (int i = 1; i <= abs(k); i++) {
      cur--;
      if (cur == -1) cur = n - 1;
    }
    cout << arr[cur] << endl;
  }
  return 0;
}
