{$APPTYPE CONSOLE}
{$O-,Q+,R+}

uses Math, SysUtils;

type
  int = integer;
  bool = boolean;
  real = extended;
var
  i, k : integer;
  a, b : array [1..6] of integer;
  rot, q : array [1..6] of boolean;
  p : array [1..6] of integer;

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

function get(i, j : integer) : integer;
begin
  if (j = 1) xor (rot[p[i]]) then get := a[p[i]] else get := b[p[i]];
end;

function check : boolean;
var a, b, c : integer;
begin
  a := get(1, 1);
  b := get(1, 2);
  c := get(2, 2);
  check := (get(2, 1) = a) and (get(3, 1) = c) and (get(3, 2) = b) and
           (get(4, 1) = c) and (get(4, 2) = b) and (get(5, 1) = a) and
           (get(5, 2) = c) and (get(6, 1) = a) and (get(6, 2) = b);
end;

procedure gen(x : integer);
var i : integer;
begin
  if x = 7 then
  begin
    if check then Yes;
    exit;
  end;
  for i := 1 to 6 do if not q[i] then
  begin
    q[i] := true;
    p[x] := i;
    gen(x + 1);
    q[i] := false;
  end;
end;

begin
  reset(input, 'box.in');
  rewrite(output, 'box.out');
  fillchar(q, sizeof(q), 0);
  for i := 1 to 6 do read(a[i], b[i]);
  for k := 0 to 63 do
  begin
    for i := 1 to 6 do rot[i] := odd(k shr (i - 1));
    gen(1);
  end;
  writeln('IMPOSSIBLE');
end.