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