program Project1;
{$APPTYPE CONSOLE}
type
  daka=record s1,s2:integer; b:boolean; end;

var
  a:array[1..6]of daka;
  c:array[1..12]of integer;

  t:boolean;

        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');
                rewrite(output);
                        if t then begin
                                writeln('POSSIBLE');
                        end
                        else begin
                                writeln('IMPOSSIBLE');
                        end;
                closefile(output);
        end;

        function check1(x1,x2:integer):boolean;
        var
          q:daka;
          r:integer;
        begin
         result:=false;
                if a[x1].s2=a[x2].s1 then begin
                a[x2].b:=true;
                  if x2-x1>1 then begin
                    q:=a[x1+1];
                    a[x1+1]:=a[x2];
                    a[x2]:=q;
                  end;
                  result:=true;
                end
                else
                if a[x1].s2=a[x2].s2 then begin
                a[x2].b:=true;
                  r:=a[x2].s1;
                  a[x2].s1:=a[x2].s2;
                  a[x2].s2:=r;
                  if x2-x1>1 then begin
                    q:=a[x1+1];
                    a[x1+1]:=a[x2];
                    a[x2]:=q;
                  end;
                  result:=true;
                end;
        end;

        procedure proc(index:integer);
        var
          i:integer;
        begin
          for i:=index+1 to 6 do begin
            if not a[i].b then begin
              if check1(index,i) then begin
                proc(index+1);
              end;
            end;
          end;
        end;

        function check:boolean;
        var
         j,kk, i:integer;
        begin
          result:=true;
          for i:=1 to 5 do begin
            if a[i].s2<>a[i+1].s1 then begin
              result:=false;
              exit;
            end;
          end;
          if a[1].s1<>a[6].s2 then result:=false;
          kk:=1;
          for i:=1 to 6 do begin
          for j:=1 to 6 do begin
            if a[i].s1=a[j].s1 then begin
              inc(c[kk]);
            end;
            if a[i].s1=a[j].s2 then begin
              inc(c[kk]);
            end;
          end;
          inc(kk);
          for j:=1 to 6 do begin
            if a[i].s2=a[j].s1 then begin
              inc(c[kk]);
            end;
            if a[i].s2=a[j].s2 then begin
              inc(c[kk]);
            end;
          end;
          inc(kk);
          end;
          for i:=1 to 12 do begin
            if (c[i] mod 4) <>0 then begin
              result:=false;
              break;
              exit;
            end;
          end;
        end;

begin
        init;
        a[1].b:=true;
        proc(1);
        t:=check;
        vivi;
        halt(0);
end.
