#include <bits/stdc++.h>
using namespace std;
int main() {
  int cmp, n, pos, mov;
  scanf("%d%d%d", &n, &pos, &mov);
  if (mov < 0) {
    mov *= -1;
    for (int i = 1; i <= mov; i++) {
      if (pos == 1) pos = n + 1;
      pos--;
    }
    if (pos == 0) pos = n;
  } else {
    for (int i = 1; i <= mov; i++) {
      if (pos == n) pos = 0;
      pos++;
    }
  }
  printf("%d\n", pos);
  return 0;
}
