#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, t, p, a, b;
  cin >> n >> a >> b;
  if (b <= 0) {
    b = -b;
    b = b % n;
    a = a - b;
    if (a < 1) {
      a = n + a;
    }
    cout << a << endl;
  } else {
    b = b % n;
    a = a + b;
    if (a > n) {
      a = a - n;
    }
    cout << a << endl;
  }
}
