#include <bits/stdc++.h>
using namespace std;
long long n, m, i, j, k, ans, t, x, tmp, mx, curr, s, f;
long long arr[1000005];
vector<pair<long long, pair<long long, long long> > > vec;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  cin >> s >> f;
  for (i = 0; i < n; i++) {
    long long st = (s - i);
    if (st <= 0) st += n;
    long long ft = (f - i);
    if (ft <= 0) ft += n;
    if (ft >= st) {
      vec.push_back(make_pair(st, make_pair(arr[i], i + 1)));
      vec.push_back(make_pair(ft, make_pair(-arr[i], i + 1)));
    } else {
      if (ft > 1) {
        vec.push_back(make_pair(1, make_pair(arr[i], i + 1)));
        vec.push_back(make_pair(ft, make_pair(-arr[i], i + 1)));
      }
      vec.push_back(make_pair(st, make_pair(arr[i], i + 1)));
      vec.push_back(make_pair(n + 1, make_pair(-arr[i], i + 1)));
    }
  }
  sort(vec.begin(), vec.end());
  ans = INT_MAX;
  for (i = 0; i < vec.size(); i++) {
    if (vec[i].second.first < 0) {
      curr += vec[i].second.first;
    } else {
      curr += vec[i].second.first;
      if (mx < curr) {
        mx = curr;
        ans = vec[i].first;
      } else if (mx == curr) {
        ans = min(ans, vec[i].first);
      }
    }
  }
  cout << ans;
  return 0;
}
