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