program taskb;
{$APPTYPE CONSOLE}
{$I+,Q+,R+,O-}
uses
  SysUtils,Math;
type
  short=smallint;
  long=longint;
  real=extended;
  bool=boolean;
var
  i: long;
  a,b: array[1..6,1..2] of long;
  p: array[1..6] of long;
  v: array[1..6] of bool;

  procedure rec2(k: long);
  var t: long;
  begin
    if k>6 then begin
      if b[1,1]<>b[2,2] then exit;
      if b[1,1]<>b[4,2] then exit;
      if b[1,2]<>b[3,2] then exit;
      if b[1,2]<>b[5,2] then exit;
      if b[2,1]<>b[5,1] then exit;
      if b[5,1]<>b[4,1] then exit;
      if b[4,1]<>b[3,1] then exit;
      if b[3,1]<>b[2,1] then exit;
      if b[6,1]<>b[1,1] then exit;
      if b[6,2]<>b[1,2] then exit;
      writeln('POSSIBLE');
      close(input);
      close(output);
      halt(0);
    end
    else begin
      rec2(k+1);
      t:=b[k,1]; b[k,1]:=b[k,2]; b[k,2]:=t;
      rec2(k+1);
    end;
  end;

  procedure rec1(k: long);
  var i: long;
  begin
    if k>6 then begin
      for i:=1 to 6 do begin
        b[p[i]]:=a[i];
        rec2(1);
      end;
    end
    else begin
      for i:=1 to 6 do
        if not v[i] then begin
          v[i]:=true;
          p[k]:=i;
          rec1(k+1);
          v[i]:=false;
        end;
    end;
  end;

begin
  assign(input,'box.in'); reset(input);
  assign(output,'box.out'); rewrite(output);

  for i:=1 to 6 do read(a[i,1],a[i,2]);
  fillchar(v,sizeof(v),false);
  rec1(1);
  writeln('IMPOSSIBLE');

  close(input);
  close(output);
end.
