program box1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  Tplate=record
  w,h:integer;
 end;
 tt=array[1..6] of tplate;

var
 v,a1:TT;
 i,j,n,k:integer;
 q,p:integer;

 fin,fout:textfile;
 f:array[1..6] of byte;
 a:array[1..12] of integer;
 find:boolean;


procedure sort;
var
t:integer;
begin
  for i:=1 to 12 do
  for j:=i to 12 do
  if (a[j]>a[i]) then
  begin
   t:=a[i];
   a[i]:=a[j];
   a[j]:=t;
  end;
end;



begin
find:=false;
 assignfile(fin,'box.in');
 assignfile(fout,'box.out');
 reset(FIN);
 REWRITE(FOUT);
 for i:=1 to 6 do
 begin
  read(fin,v[i].w,v[i].h);
  if v[i].w=v[i].h then
   begin
      q:=8;
      inc(p);
         if p=6 then find:=true;
    end;
  writeln(fout,v[i].w,' ',v[i].h);
 end;
 if not(find) then
  begin
      j:=1;
      for i:=1 to 6 do begin
       a[j]:=v[i].w;  inc(j);
       a[j]:=v[i].h; inc(j);
       end;
       sort;
   if q=8 then begin
                if (a[1]=a[8]) or (a[5]=a[12]) and (a[1]=a[4]) or (a[9]=a[12]) then find:=true;
               end
      else
    if  (a[1]=a[4]) and (a[5]=a[8]) and (a[9]=a[12]) then    find:=true;
       end;

 if  find then write(fout,'POSSIBLE') else write(fout,'IMPOSSIBLE');
 closefile(fin);
 closefile(fout);

end.
