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