uses
  SysUtils, testlib;
var
  i, n, j : longint;
  ja1, ja2, pa1, pa2 : longint;
  s, js, ps : int64;
  x, y : array [1..100000] of int64;

begin
  n := inf.ReadLongint;
  for i := 1 to n do begin
    x[i] := inf.ReadLongint;
    y[i] := inf.ReadLongint;
  end;
  s := 0;
  for i := 1 to n do begin
    j := i mod n + 1;
    s := s + x[i] * y[j] - x[j] * y[i];
  end;
  s := abs(s);
  ja1 := ans.ReadLongint;
  ja2 := ans.ReadLongint;
  if (ja1 > ja2) then begin
    j := ja1;
    ja1 := ja2;
    ja2 := j;
  end;
  js := 0;
  if (ja1 = ja2) then
    js := s
  else begin
    for i := ja1 to ja2 - 1 do
      js := js + x[i] * y[i + 1];
    for i := ja1 + 1 to ja2 do
      js := js - x[i] * y[i - 1];
    js := js + x[ja2] * y[ja1] - x[ja1] * y[ja2];
    js := abs(js);
    if (s - js > js) then
      js := s - js;
  end;
  pa1 := ouf.ReadLongint;
  pa2 := ouf.ReadLongint;
  if (pa1 < 1) or (pa1 > n) then
    quit(_wa, 'Wrong number of vertex: ' + IntToStr(pa1));
  if (pa2 < 1) or (pa2 > n) then
    quit(_wa, 'Wrong number of vertex: ' + IntToStr(pa2));
  if (pa1 > pa2) then begin
    j := pa1;
    pa1 := pa2;
    pa2 := j;
  end;
  ps := 0;
  if (pa1 = pa2) then
    ps := s
  else begin
    for i := pa1 to pa2 - 1 do
      ps := ps + x[i] * y[i + 1];
    for i := pa1 + 1 to pa2 do
      ps := ps - x[i] * y[i - 1];
    ps := ps + x[pa2] * y[pa1] - x[pa1] * y[pa2];
    ps := abs(ps);
    if (s - ps > ps) then
      ps := s - ps;
  end;
  if (ps > js) then
    quit(_wa, 'Partcipant''s bigger piece = ' + intToStr(ps) + '; jury bigger piece = ' + intToStr(js));
  if (ps < js) then
    quit(_fail, 'Partcipant''s bigger piece = ' + intToStr(ps) + '; jury bigger piece = ' + intToStr(js));
  quit(_ok, intToStr(pa1) + ' ' + intToStr(pa2));
end.