#include <bits/stdc++.h>
int fx[] = {-1, +0, +1, +0, +1, +1, -1, -1, +0};
int fy[] = {+0, -1, +0, +1, +1, -1, +1, -1, +0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
using namespace std;
bool comp(int x, int y) { return x > y; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a, b, cnt = 0;
  cin >> n >> a >> b;
  if (b < 0) {
    int bk = b;
    ;
    while (abs(bk) > cnt) {
      a--;
      cnt++;
      if (a == 0) a = n;
    }
  } else if (b > 0) {
    int bk = b;
    while (bk > cnt) {
      a++;
      cnt++;
      if (a == n + 1) a = 1;
    }
  }
  cout << a << endl;
  return 0;
}
