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