#include <bits/stdc++.h>
using namespace std;
void Show(vector<long long> v) {
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
void Show(long long v[], int n) {
  for (int i = 0; i < n; i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<long long> People;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    People.push_back(a);
  }
  int s, f;
  cin >> s >> f;
  f--;
  int num = abs(f - s);
  for (int i = 0; i < num; i++) {
    People.push_back(People[i]);
  }
  long long dpSum[People.size()];
  dpSum[0] = People[0];
  for (int i = 1; i < People.size(); i++) {
    dpSum[i] = dpSum[i - 1] + People[i];
  }
  long long dpAns[n];
  dpAns[0] = dpSum[num];
  for (int i = 1; i < n; i++) {
    dpAns[i] = dpSum[i + num] - dpSum[i - 1];
  }
  long long xam = -1;
  for (int i = 0; i < n; i++) {
    if (dpAns[i] > xam) {
      xam = dpAns[i];
    }
  }
  int change[n];
  for (int i = 0; i < n; i++) {
    change[i] = s - i;
    if (change[i] <= 0) {
      change[i] += n;
    }
  }
  vector<int> time;
  for (int i = 0; i < n; i++) {
    if (dpAns[i] == xam) {
      time.push_back(change[i]);
    }
  }
  sort(time.begin(), time.end());
  cout << time[0];
  return 0;
}
