program Project3;
{$APPTYPE CONSOLE}
type box=record h,v:integer;end;
var
a,b: array [1..6] of box;
 temp,x,col,j,i:integer;
 fi,fo:text;
 f:boolean;
begin
        assign(fi,'box.in');
        reset(fi);
        for i:=1 to 6 do
                begin
                readln(fi,a[i].h,a[i].v);
                if (a[i].h>a[i].v) then
                   begin temp:=a[i].v;a[i].v:=a[i].h; a[i].h:=temp;
                   end;
                end;
        close(fi);
        assign(fo,'box.out');
        rewrite(fo);
         for i:=1 to 6 do
         for j:=1 to 6 do
                begin
               if (a[i].h>a[j].h) then
                   begin temp:=a[i].v;a[i].v:=a[j].v; a[j].v:=temp;
                         temp:=a[i].h;a[i].h:=a[j].h; a[j].h:=temp;
                   end;
                end;
         for i:=1 to 6 do
         for j:=1 to 6 do
                begin
               if (a[i].h=a[j].h) then
               if(a[i].v>a[j].v) then
                  begin
                         temp:=a[i].v;a[i].v:=a[j].v; a[j].v:=temp;
                         temp:=a[i].h;a[i].h:=a[j].h; a[j].h:=temp;
                   end;
                end;

                if((a[3].h=a[4].h)and(a[4].h=a[5].h)and(a[5].h=a[6].h))and
                ((a[1].v=a[2].v)and(a[2].v=a[3].v)and(a[3].v=a[4].v))and
                ((a[1].h=a[2].h)and(a[2].h=a[5].v)and(a[5].v=a[6].v))
                then writeln(fo,'POSSIBLE')
                else writeln(fo,'IMPOSSIBLE');

close(fo);


end.

