#include <bits/stdc++.h>
int main() {
  int n, a, b;
  while (scanf("%d%d%d", &n, &a, &b) != EOF) {
    int c[202] = {0};
    int t = 1, i, j, k;
    if (b >= 0) {
      for (int i = 1; i <= n; i++) c[i] = i;
      for (int j = n + 1; j <= 2 * n; j++) c[j] = c[j - n];
      printf("%d\n", c[a + (b % n)]);
    }
    if (b < 0) {
      for (i = 1; i <= n; i++) c[i] = i;
      for (j = n + 1; j <= 2 * n; j++) c[j] = c[j - n];
      printf("%d\n", c[a + n - (-b) % n]);
    }
  }
  return 0;
}
