unit look;
interface
  function Compare(x,y:longint):Integer;
  function GetN:longint;
  procedure Answer(x:longint);
implementation
Const
  MaxN=1000000; {max. # sticks}
  Init:boolean=true;
Var
  N:longint;    {# sticks}
  S:Array[1..maxN] of longint;

procedure ReadIn;
var inFile:Text;
  x,i:longint;
begin
  assign(inFile,'sticks.in'); reset(inFile);
  readln(inFile,N);
  For i:=1 To N Do Begin
    Read(inFile, x);
    S[i]:=x;
  End {for i};
  close(inFile);
  Init:=false;
end {Readin};

Function Compare(x,y:longint):Integer;
Begin {Compare}
  if Init then begin
    writeln('ERROR: You must call GetN first!');
    Halt(1);
  end;
  if (x<1)or(x>N)or(y<1)or(y>N)  then begin
    writeln('ERROR: Illegal argument of Compare');
    Halt(1);
  end;
  if S[x]<S[y] then
    Compare:=-1
  else if S[x]>S[y] then
    Compare:=1
  else
      Compare:=0
End {Compare};

function GetN:longint;
begin
  if Init then
    ReadIn;
  GetN:=N;
end {GetN};

procedure Answer(x:longint);
var
  outFile:Text;
begin
  if Init then begin
    writeln('ERROR: You must call GetN first!');
    Halt(1);
  end;
  assign(outFile,'sticks.out'); rewrite(outFile);
  writeln(outFile, x);
  close(outFile);
  Halt;
end {Answer};

begin
  ReadIn;
end.
