#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  bool flag = true;
  if (b < 0) {
    b = -b;
    flag = false;
  }
  b %= n;
  if (b == 0)
    cout << a << endl;
  else {
    if (flag) {
      a += b;
      if (a > n) a -= n;
      cout << a << endl;
    } else {
      a -= b;
      if (a <= 0) {
        a = n + a;
      }
      cout << a << endl;
    }
  }
  return 0;
}
