program zb;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a: array[1..6,0..1] of integer;
procedure sw(i:integer);
  var
    t: integer;
  begin
    t := a[i,0];
    a[i,0] := a[i,1];
    a[i,1] := t;
  end;
procedure check;
  begin
    if (a[1,0]=a[2,0])and(a[2,1]=a[3,1])and(a[3,0]=a[1,1]) then
      begin
        writeln('POSSIBLE');
        halt;
      end;
  end;
procedure NO;
  begin
    writeln('IMPOSSIBLE');
    halt;
  end;
var
  t,x,y,n,i,j,k:integer;
  z:array[1..6] of integer;
begin
  assign(input,'box.in');
  assign(output,'box.out');
  reset(input);
  rewrite(output);
  n := 0;
  fillchar(z,sizeof(z),0);
  for i := 1 to 6 do
    begin
      read(x,y);
      if x>y then begin t := x; x := y; y := t; end;
      j := 1;
      while (j<=n) and ((z[j]<>1)or(a[j][0]<>x)or(a[j][1]<>y)) do inc(j);
      if j > n then
        begin
          inc(n);
          a[n][0] := x;
          a[n][1] := y;
        end;
      inc(z[j]);
    end;
  if n<>3 then NO;

  check;
  sw(1);
  check;
  sw(1);
  sw(2);
  check;
  sw(1);
  check;
  sw(1);
  sw(2);
  sw(3);
  check;
  sw(1);
  check;
  sw(1);
  sw(2);
  check;
  sw(1);
  check;

  t := a[2,0];
  a[2,0] := a[3,0];
  a[3,0] := t;
  t := a[2,1];
  a[2,1] := a[3,1];
  a[3,1] := t;

  check;
  sw(1);
  check;
  sw(1);
  sw(2);
  check;
  sw(1);
  check;
  sw(1);
  sw(2);
  sw(3);
  check;
  sw(1);
  check;
  sw(1);
  sw(2);
  check;
  sw(1);
  check;

  NO;
end.
