program box;

{$APPTYPE CONSOLE}
uses
  SysUtils;

  label 1;
  const
p1='POSSIBLE';
p2='IMPOSSIBLE';

var
i,k,h,j:integer;
f1,f2:text;
s:string;
a:array[1..6,1..2] of integer;
a1:array[1..6,1..2] of integer;
b:array[1..3] of integer;
c:array[1..2] of integer;
begin
assign(f1,'box.in');reset(f1);
for i:=1 to 6 do for k:=1 to 2 do begin read(f1,a[i,k]);a1[i,k]:=a[i,k];end;
close(f1);
for i:=1 to 6 do begin
writeln;
for k:=1 to 2 do write(a1[i,k],' ');
end;
j:=1;
b[j]:=a1[1,1];
for i:=1 to 6 do begin
if a1[i,1]=b[j] then a1[i,1]:=0 else
if a1[i,2]=b[j] then a1[i,2]:=0;
end;
j:=2;
b[j]:=a1[1,2];
for i:=1 to 6 do begin
if a1[i,1]=b[j] then a1[i,1]:=0 else
if a1[i,2]=b[j] then a1[i,2]:=0;
end;
j:=3;
for i:=1 to 6 do for k:=1 to 2 do if a1[i,k]<>0 then begin b[j]:=a1[i,k];break;end;
for i:=1 to 6 do begin
if a1[i,1]=b[j] then a1[i,1]:=0 else
if a1[i,2]=b[j] then a1[i,2]:=0;
end;
j:=0;
for i:=1 to 6 do if (a1[i,1]=0)  and (a1[i,2]=0) then j:=j+1;
if j<>6 then begin s:=p2;goto 1;end;
for i:=2 to 6 do
if ((a[i,1]=b[1]) and (a[i,2]=b[2])) or (((a[i,1]=b[2]) and (a[i,2]=b[1]))) then begin
a[1,1]:=0;a[1,2]:=0;a[i,1]:=0;a[i,2]:=0;end;

for i:=2 to 6 do if a[i,1]<>0 then begin
for k:=i+1 to 6 do if ((a[i,1]=a[k,1]) and (a[i,2]=a[k,2])) or (((a[i,1]=a[k,2]) and (a[i,2]=a[k,1]))) then begin
a[i,1]:=0;a[i,2]:=0;a[k,1]:=0;a[k,2]:=0;end;
end;

for i:=2 to 6 do if a[i,1]<>0 then begin
for k:=i+1 to 6 do if ((a[i,1]=a[k,1]) and (a[i,2]=a[k,2])) or (((a[i,1]=a[k,2]) and (a[i,2]=a[k,1]))) then begin
a[i,1]:=0;a[i,2]:=0;a[k,1]:=0;a[k,2]:=0;end;
end;
j:=0;
for i:=1 to 6 do if (a[i,1]=0)  and (a[i,2]=0) then j:=j+1;
if j<>6 then begin s:=p2;goto 1;end;
s:=p1;
1: assign(f2,'box.out');rewrite(f2);
writeln(f2,s);close(f2);
readln;
end.
