program Bzadacha;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var a:array[1..10] of integer;
    n,y,i,j,x,l,r:integer;

begin
  Readln(n);
  for i:=1 to n do
  begin
    read(a[i]);
  end;
  i:=l;
  j:=r;
  x:=a[(l+r) div 2];
  repeat
    while (a[i]<x) do inc(i);
    while (x<A[j]) do dec(j);
    if (i<= j) then
    begin
      y:=A[i];
      a[i]:=a[j];
      a[j]:=y;
      inc(i);
      dec(j);
    end;
  until (i>j);
  Writeln(l,' ',r);



end.
