#include <bits/stdc++.h>
using namespace std;
int n;
int a[210];
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
    for (int i = n; i < 2 * n; ++i) a[i] = a[i - n];
    int s, t;
    scanf("%d%d", &s, &t);
    s--, t--;
    if (s > t) swap(s, t);
    int ans1 = 0, ans2 = 0;
    for (int i = s; i < t; ++i) {
      ans1 += a[i];
    }
    for (int i = t; i < s + n; ++i) {
      ans2 += a[i % n];
    }
    int ans = min(ans1, ans2);
    printf("%d\n", ans);
  }
  return 0;
}
