{$APPTYPE CONSOLE}
const n=6;
var a0,b0,a,b:array[1..n] of longint;
    ans:boolean;

procedure readdata;
var i:longint;
begin
 for i:=1 to n do
 read(a[i],b[i]);
end;

procedure swap(var a,b:longint);
var t:longint;
begin
 t:=a;a:=b;b:=t;
end;

procedure solve;
var k,i,i1,i2,i3,i4,i5,i6:longint;
begin
 ans:=false;
 a0:=a;
 b0:=b;
 for k:=0 to 1 shl n-1 do
 begin
  a:=a0;
  b:=b0;
  for i:=1 to n do
  if k and (1 shl (i-1))<>0 then
   begin
    swap(a[i],b[i]);
   end;
  for i1:=1 to n do
  for i2:=1 to n do
  if i2<>i1 then
  for i3:=1 to n do
  if (i3<>i1) and (i3<>i2) then
  for i4:=1 to n do
  if (i4<>i1) and (i4<>i2) and (i4<>i3) then
  for i5:=1 to n do
  if (i5<>i1) and (i5<>i2) and (i5<>i3) and (i5<>i4) then
  begin
   i6:=21-i1-i2-i3-i4-i5;
   if (a[i1]=a[i5]) and (a[i1]=a[i3]) and (a[i1]=a[i6]) and
      (b[i1]=b[i2]) and (b[i1]=b[i4]) and (b[i1]=b[i6]) and
      (b[i5]=b[i3]) and (b[i5]=a[i2]) and (b[i5]=a[i4]) then
   begin
    ans:=true;
    exit;
   end; 
  end;
 end; 
end;

procedure outdata;
begin
 if ans then
  writeln('POSSIBLE')
 else
  writeln('IMPOSSIBLE'); 
end;

begin
 assign(input,'box.in');
 reset(input);
 assign(output,'box.out');
 rewrite(output);
 readdata;
 solve;
 outdata;
 close(output);
end.
