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