N = gets.to_i S, T = gets.split.map(&:to_i) A = gets.split.map(&:to_i) R1 = [0] R2 = [0] (S).upto(T - 2) do |i| R1 << R1.last + A[i] end (S - 2).downto(T - N) do |i| R2 << R2.last + A[i] end x = A[S - 1] y = A[T - 1] c1 = T - S - 1 c2 = S + N - T - 1 if c1.even? && c2.even? x += R1[c1 / 2] + R2[c2 / 2] y += (R1.last - R1[c1 / 2]) + (R2.last - R2[c2 / 2]) elsif c1.even? x += R1[c1 / 2] + R2[c2 / 2 + 1] y += (R1.last - R1[c1 / 2]) + (R2.last - R2[c2 / 2 + 1]) elsif c2.even? x += R1[c1 / 2 + 1] + R2[c2 / 2] y += (R1.last - R1[c1 / 2 + 1]) + (R2.last - R2[c2 / 2]) else x1 = x + R1[c1 / 2] + R2[c2 / 2 + 1] y1 = y + (R1.last - R1[c1 / 2]) + (R2.last - R2[c2 / 2 + 1]) x2 = x + R1[c1 / 2 + 1] + R2[c2 / 2] y2 = y + (R1.last - R1[c1 / 2 + 1]) + (R2.last - R2[c2 / 2]) if x1 - y1 < x2 - y2 x, y = x2, y2 else x, y = x1, y1 end end puts x - y