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