#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, m, q;
  cin >> n >> m >> q;
  int now = (m + q);
  if (now < 0) {
    cout << n - abs(now) % n << endl;
  } else if (now == 0)
    cout << n << endl;
  else {
    if (now % n == 0)
      cout << n << endl;
    else
      cout << now % n << endl;
  }
  return 0;
}
