program Project2;

uses
  SysUtils;

var
	mas: array [1..6, 1..2] of integer;
  b: array [1..6] of boolean;
  i, j, front1, front2, w, h, step: integer;
  flag: boolean;

procedure outp(ans: boolean);
begin
	if ans then
  	writeln('POSSIBLE')
  else
  	writeln('IMPOSSIBLE');
  halt(0);
end;

function find(x: integer): integer;
var
	i, other: integer;
begin
	for i :=1 to 6 do
  	if b[i] then
    begin
    	other := 0;
    	if (x = mas[i, 1]) then
      	other := mas[i, 2]
      else
      if (x = mas[i, 2]) then
      	other := mas[i, 1];
      if other > 0 then
			begin
      	b[i] := false;
        flag := false;
        for j := 1 to 6 do
        begin
        	if b[j] then
          begin
          	if (mas[j, 1] = mas[i, 1]) and (mas[j, 2] = mas[i, 2]) then
						begin
							b[j] := false;
              if step = 0 then
              begin
              	inc(step);
              	if other = find(front2) then
                	outp(true);
                dec(step);
              end else
              begin
              	result := other;
                exit;
              end;
              b[j] := true;
            end;
          end;
        end;
        b[i] := true;
      end;
    end;
  result := 0;
end;

begin
	assignfile(input, 'box.in');
  assignfile(output, 'box.out');
  reset(input);
  rewrite(output);
  //
  for i := 1 to 6 do
  begin
  	readln(w, h);
    if w > h then
    begin
    	mas[i, 1] := h;
      mas[i, 2] := w;
    end
    else
    begin
    	mas[i, 1] := w;
      mas[i, 2] := h;
    end;
    b[i] := true;
  end;
  front1 := mas[1, 1]; front2 := mas[1, 2];
  b[1] := false;

  i := 1;
  flag := false;
  for j := 1 to 6 do
  begin
    if b[j] then
    begin
      if (mas[j, 1] = mas[i, 1]) and (mas[j, 2] = mas[i, 2]) then
      begin
        b[j] := false;
        flag := true;
        break;
      end;
    end;
  end;
  if flag then
  begin
  	step := 0;
  	find(front1);
  end;
  outp(false);

  //
end.
