program Project1;
{$APPTYPE CONSOLE}

type
  daka=record s1,s2:integer; b:boolean; end;

var
  a:array[1..6]of daka;
  b:array[1..6]of integer;
  t:boolean;
  k:integer;

        procedure init;
        var
          i:integer;
        begin
                assignfile(input,'box.in');
                reset(input);
                        for i:=1 to 6 do begin
                                readln(a[i].s1, a[i].s2);
                                a[i].b:=false;
                        end;
                closefile(input);
        end;

        procedure vivi;
        begin
                assignfile(output,'box.out');
                reset(output);
                        if t then begin
                                writeln('POSSIBLE');
                        end
                        else begin
                                writeln('IMPOSSIBLE');
                        end;
                closefile(output);
        end;

        function update(q1,q2:integer):boolean;
        var
          r:integer;
        begin
          if a[q1].s2=a[q2].s1 then begin
            result:=true;
          end;
          if a[q1].s2=a[q2].s2 then begin
            result:=true;
            r:=a[q2].s1;
            a[q2].s1:=a[q2].s2;
            a[q2].s2:=r;
          end;
        end;

        procedure proc;
        var
          i,j:integer;
        begin
         k:=0;
          for i:=1 to 5 do begin
            for j:=1 to 6 do begin
              if (i<>j) and (not a[j].b) then begin
                if update(i,j) then begin
                  a[j].b:=true;
                  inc(k);
                  b[k+1]:=j;
                  break;
                end;
              end;
            end;
          end;
        end;

        procedure check;
        begin
                t:=false;
          if k=5 then begin
            if a[1].s1=a[b[6]].s2 then begin
              t:=true;
            end;
          end;
        end;

begin
        init;
        a[1].b:=true;
        b[1]:=1;
        proc;
        check;
        vivi;
end.
