// T24 Djizak SPI

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var     f1,f2:textfile;
        a,b:array of integer;
        i:integer;
label chiq;
begin
        setlength(a,7);
        setlength(b,7);
        assignfile(f1,'box.in');
        assignfile(f2,'box.out');
        reset(f1);
        rewrite(f2);
        for i:=1 to 6 do
        read(f1,a[i],b[i]);
        //t:=1;
        //t1:=1;
        //t2:=1;
        //c[1]:=a[1];
        //d[1]:=0;
        for i:=2 to 6 do
        begin
        if not ((a[i]=b[i-1]) or (a[i]=a[i-1]) or (b[i]=a[i-1]) or (b[i]=b[i-1])) then
                begin
                write(f2,'IMPOSSIBLE');
                goto chiq;
                end;

        end;
        if not ((a[6]=b[1]) or (a[6]=a[1]) or (b[6]=a[1]) or (b[6]=b[1])) then
                begin
                write(f2,'IMPOSSIBLE');
                end;
        write(f2,'POSSIBLE');
chiq:   closefile(f1);
        closefile(f2);
end.
