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