#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  if (b < 0) {
    int j = a;
    for (int i = 0; i < -b; i++) {
      if (j == 1) {
        j = n;
      } else {
        j--;
      }
    }
    cout << j << endl;
  } else {
    int j = a;
    for (int i = 0; i < b; i++) {
      if (j == n - 1) {
        j = n;
      } else if (j == n) {
        j = 1;
      } else {
        j++;
      }
    }
    cout << j << endl;
  }
  return 0;
}
