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