program HelloWorld;
var a: array of integer;
var N, min, max, i, variable:integer;
begin
min := 32767;
max := 0;
readln(N);
for i := 0 to N do begin
readln(variable);
if (variable > 0) and (variable mod 2 = 0) and (variable > max) then
max := variable;
if (variable > 0) and (variable mod 2 = 0) and (variable < min) then
min := variable;
end;
if (max <> 0) and (min <> 32767) then
writeln(min, ' ', max)
else
writeln(-1);
end.