Var m:array of integer;
a,b,i,n,min,max:integer;
begin
readln(n,a,b);
setlength(m,n);
n-=1;
a-=1;
b-=1;
max:=a;
min:=a;
for i:=0 to n do begin
read(m[i]);
if (i>=a) and (i<=b) and (m[i]>m[max]) then max:=i;
if (i>=a) and (i<=b) and (m[i]<m[min]) then min:=i;<br>end;
writeln('Min ',m[min],' Max ',m[max]);
end.