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)] t=(t-s)%N a,b=t-1,N-t-1 ans=2*B[0]-sum(B) u=v=0 while 2*(u+v)