#include <bits/stdc++.h>
int main() {
  int n, a[102], sum1 = 0, sum2 = 0;
  int s, t;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  scanf("%d %d", &s, &t);
  if (s == t) {
    printf("0\n");
  } else {
    int i;
    if (s > t) {
      s ^= t;
      t ^= s;
      s ^= t;
    }
    for (i = s - 1; i < t - 1; i++) sum1 += a[i];
    for (i = t - 1; i < n; i++) sum2 += a[i];
    for (i = 0; i < s - 1; i++) sum2 += a[i];
    int ans;
    sum1 > sum2 ? (ans = sum2) : (ans = sum1);
    printf("%d\n", ans);
  }
  return 0;
}
