var
  a: array [0..6, 1..2] of longint;
  k, j, i, t, q, w, e: longint;
  bool: boolean;

begin
  assign(input, 'box.in');
  assign(output, 'box.out');
  reset(input);
  rewrite(output);
  for i := 1 to 6 do
  begin
    readln(a[i][1], a[i][2]);
    if a[i][1] > a[i][2] then
    begin
      t := a[i][1];
      a[i][1] := a[i][2];
      a[i][2] := t;
    end;
  end;
  a[0][1] := 0;
  a[0][2] := 0;
  q := 1;
  w := 0;
  e := 0;
  for i := 1 to 6 do
    if (a[i][1] <> a[q][1]) or (a[i][2] <> a[q][2]) then
    begin
      w := i;
      break;
    end;
  for i := 1 to 6 do
    if ((a[i][1] <> a[q][1]) or (a[i][2] <> a[q][2])) and ((a[i][1] <> a[w][1]) or (a[i][2] <> a[w][2])) then
    begin
      e := i;
      break;
    end;
  bool := false;
  for i := 1 to 6 do
    if ((a[i][1] <> a[q][1]) or (a[i][2] <> a[q][2])) and ((a[i][1] <> a[w][1]) or (a[i][2] <> a[w][2])) and ((a[i][1] <> a[e][1]) or (a[i][2] <> a[e][2])) then
    begin
      bool := true;
      break;
    end;
  if bool then
  begin
    write('IMPOSSIBLE');
    close(input);
    close(output);
    exit;
  end
  else
  begin
    if (w = 0) and (e = 0) then
    begin
      w := 1;
      e := 1;
    end
    else
      if (w <> 0) and (e = 0) then
      begin
        j := 0;
        for i := 1 to 6 do
          if (a[q][1] = a[i][1]) and (a[q][2] = a[i][2]) then
            inc(j);
        if j = 4 then
          e := q
        else
          e := w;
      end;
    for j := 1 to 2 do
      for t := 1 to 2 do
        for i := 1 to 2 do
         if (a[q][j] = a[w][t]) and (a[q][3 - j] = a[e][i]) and (a[e][3 - i] = a[w][3 - t]) then
          begin
            write('POSSIBLE');
            close(input);
            close(output);
            exit;
          end;
  end;
  write('IMPOSSIBLE');
  close(input);
  close(output);
end.
