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