#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, b, k;
  cin >> n >> b >> k;
  if (k > n) {
    k = k - k / n * n;
  }
  if (k < 0) {
    while (k < 0) {
      k++;
      b--;
      if (b == 0) b = n;
    }
  } else if (k > 0) {
    while (k > 0) {
      k--;
      b++;
      if (b == n + 1) b = 1;
    }
  }
  cout << b;
}
