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