#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n;
  cin >> n;
  long long int a[2 * n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    a[i + n] = a[i];
  }
  long long int s, f;
  cin >> s >> f;
  long long int len = f - s;
  long long int cnt = 0;
  long long int sum = 0;
  long long int mx = -1;
  vector<long long int> ind;
  for (long long int i = 0; i < 2 * n; i++) {
    cnt++;
    sum += a[i];
    if (cnt == len) {
      mx = max(mx, sum);
      sum -= a[i - len + 1];
      cnt--;
    }
  }
  cnt = 0;
  sum = 0;
  for (long long int i = 0; i < 2 * n; i++) {
    cnt++;
    sum += a[i];
    if (cnt == len) {
      if (sum == mx) ind.push_back(i - len + 1);
      sum -= a[i - len + 1];
      cnt--;
    }
  }
  long long int ans = 1e18;
  for (auto it : ind) {
    if (it >= n) it -= n;
    long long int time = s - it;
    if (time <= 0) time = n + time;
    ans = min(ans, time);
  }
  cout << ans;
}
