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