program Project2;
{$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);
          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;

procedure proc;
var
  kk,i,j:integer;
  k:integer;
begin
   t:=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;

          {all 4}
          k:=0;
          for i:=1 to 12 do begin
            if c[i]=4 then begin
              inc(k);
            end;
          end;
          if k=12 then begin
            k:=0;
            for i:=1 to 6 do begin
              if a[i].s1<>a[i].s2 then inc(k);
            end;
            if k=6 then begin
              t:=true;
              exit;
            end;
          end;

          {all 12}
          k:=0;
          for i:=1 to 12 do begin
            if c[i]=8 then begin
              inc(k);
            end;
          end;
          if k=8 then begin
            k:=0;
            for i:=1 to 12 do begin
              if c[i]=4 then begin
                inc(k);
              end;
            end;
            if k=4 then begin
              k:=0;
              for i:=1 to 6 do begin
                if a[i].s1=a[i].s2 then begin
                  inc(k);
                end;
              end;
              if k=2 then begin
                t:=true;
                exit;
              end;
            end;
          end;
          {}
          k:=0;
          for i:=1 to 12 do begin
            if c[i]=12 then begin
              inc(k);
            end;
          end;
          if k=12 then begin
            t:=true;
            exit;
          end;




end;

begin
 init;
 proc;
 vivi;
end.
