program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
sum,position:integer;
mas:array[1..6,1..2] of integer;
chislo:array[1..12] of integer;
i,k,j:integer;
f,f1:text;
pos:boolean;
a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,a6,b6:integer;
procedure find(i,j:integer);
var
h:integer;
begin
h:=0;
for k:=1 to 12 do
if mas[i,j]=chislo[k] then
begin
h:=1;
end;
if h=0 then begin
position:=position+1; chislo[position]:=mas[i,j];
end;
end;
begin
pos:=true;
assign(f,'box.in');
reset(f);
read(f,mas[1,1]);
readln(f,mas[1,2]);
read(f,mas[2,1]);
readln(f,mas[2,2]);
read(f,mas[3,1]);
readln(f,mas[3,2]);
read(f,mas[4,1]);
readln(f,mas[4,2]);
read(f,mas[5,1]);
readln(f,mas[5,2]);
read(f,mas[6,1]);
readln(f,mas[6,2]);
close(f);
position:=0;

for i:=1 to 12 do chislo[i]:=0;

for i:=1 to 6 do
for j:=1 to 2 do
find(i,j);
if position>3 then pos:=false;
sum:=0;
for i:=1 to 6 do
sum:=sum+mas[i,1]*mas[i,2];
if (position = 3)then
begin
if sum<>(chislo[1]*chislo[2]+chislo[1]*chislo[3]+chislo[2]*chislo[3])*2 then pos:=false;
end;
if (position = 2) then
begin
sum:=0;
for i:=1 to 6 do
if mas[i,1]<>mas[i,2] then sum:=sum+1;
if sum<>4 then pos:=false;
end;
assign(f1,'box.out');
rewrite(f1);
if pos then write(f1,'POSSIBLE') ELSE write(f1,'IMPOSSIBLE');
close(f1);
end.
