N=int(input()) s,t=map(int,input().split()) A=[int(x) for x in input().split()] B=[A[(i+s-1)%N] for i in range(N)] s,t=0,(t-s)%N a,b=t-s-1,N-t-1 ans=2*B[0]-sum(B) u=v=0 while 2*(u+v)