{$R+,Q+,O-}
{$MINSTACKSIZE $00404000}
{$APPTYPE CONSOLE}
type
  int = longint;

var
  i, j, k: int;
  a, b: array[1..6] of int;
  val, num: array[1..12] of int;
  len: int;
  add: boolean;
  e: array[1..3, 1..3] of int;

procedure impos;
begin
  writeln('IMPOSSIBLE');
  halt;
end;

procedure poss;
begin
  writeln('POSSIBLE');
  halt;
end;

begin
  assign(input, 'box.in');
  assign(output, 'box.out');
  reset(input);
  rewrite(output);
  len := 0;
  for i := 1 to 6 do
  begin
    read(a[i], b[i]);
    add:=false;
    for j := 1 to len do if (a[i] = val[j]) then
    begin
      inc(num[j]);
      add:=true;
      break;
    end;
    if not add then
    begin
      inc(len);
      val[len] := a[i];
      num[len] := 1;
    end;
    add :=  false;
    for j := 1 to len do if (b[i] = val[j]) then
    begin
      inc(num[j]);
      add:=true;
      break;
    end;
    if not add then
    begin
      inc(len);
      val[len] := b[i];
      num[len] := 1;
    end;
  end;
  if (len > 3) then
    impos;
  for i := 1 to len do
  begin
    if (num[i] mod 4 <> 0) then
      impos;
  end;
  for i := 1 to 6 do
  begin
    j := 0;
    repeat
      inc(j);
    until (val[j] = a[i]);
    k := 0;
    repeat
      inc(k);
    until (val[k] = b[i]);
    inc(e[j, k]);
    inc(e[k, j]);
  end;
  if (len = 3) then
  begin
    if (e[1,2]=2) and(e[1,3] =2) and(e[2,3] = 2) then
      poss
    else
      impos;
  end;
  if (len = 2) then
  begin
    if (e[1,2] <> 4) then
      impos;
    if (e[1, 1] = 4) or (e[2, 2] = 4) then
      poss;
    impos;
  end;
  poss;
end.
