#include <bits/stdc++.h>
int main() {
  int n, a, b;
  while (scanf("%d%d%d", &n, &a, &b) != EOF) {
    if (b > 0)
      for (int i = 0; i < b; i++) {
        a++;
        if (a > n) a = 1;
      }
    else if (b < 0)
      for (int i = 0; i > b; i--) {
        a--;
        if (a < 1) a = n;
      }
    printf("%d\n", a);
  }
  return 0;
}
