#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int k, l, x, y;
  cin >> x >> y;
  k = min(x, y);
  l = max(x, y);
  int sum = 0, sum1 = 0;
  int i = k;
  while (i % l != 0) {
    sum += a[i - 1];
    i++;
    if (i > n) i %= n;
  }
  i = l;
  while (i != k) {
    sum1 += a[i - 1];
    i++;
    if (i > n) i %= n;
  }
  cout << min(sum, sum1);
}
