#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int main(void) {
  int n, a, b;
  scanf("%d %d %d", &n, &a, &b);
  int k = 0;
  if (b < 0)
    k = -1;
  else
    k = 1;
  b = abs(b);
  while (b) {
    a = a + k;
    if (a == n + 1) a = 1;
    if (a == 0) a = n;
    b--;
  }
  cout << a << endl;
  return 0;
}
