#include <bits/stdc++.h>
using namespace std;
int arr[200];
int main(int argc, char const *argv[]) {
  int n, a, b;
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) arr[i] = i + 1;
  if (b < 0) {
    b = abs(b);
    a -= 1;
    while (b--) {
      a = a - 1;
      a += n;
      a %= n;
    }
    cout << arr[a] << endl;
  } else {
    b = abs(b);
    a -= 1;
    while (b--) {
      a = a + 1;
      a += n;
      a %= n;
    }
    cout << arr[a] << endl;
  }
  return 0;
}
