#include <bits/stdc++.h>
using namespace std;
bool status[1100002];
int main() {
  int n, a, b;
  while (cin >> n >> a >> b) {
    if (b < 0) {
      while (b) {
        a = a - 1;
        b++;
        if (a == 0) {
          a = n;
        }
      }
    } else {
      while (b) {
        a = a + 1;
        b--;
        if (a > n) {
          a = 1;
        }
      }
    }
    cout << a << endl;
  }
}
