var a, b, c, d : integer;

begin
   assign(input,  'domino.in'); reset(input);
   assign(output,'domino.out'); rewrite(output);
   read(a, b);    read(c, d);

   if a = c then write(b,' ',a,' ',a,' ',d) else
   if a = d then write(b,' ',a,' ',a,' ',c) else
   if b = c then write(a,' ',b,' ',b,' ',d) else
   if b = d then write(a,' ',b,' ',b,' ',c) else
   write('-1');

   close(input); close(output);
end.