{$apptype console}
{ $q+,r+,o-}
{$q+,r+,o+}
{ $q-,r-,o+}

uses
  math, sysutils;

type
  int = longint;
  bool = boolean;
  float = extended;

  tedge = record
    w, h: integer;
  end;

const
  fn = 'box';

var
  s: array[1..6] of tedge;

procedure swapmin( var x, y: integer );
var
  t: integer;
begin
  if ( x > y ) then begin
    t := x; x := y; y := t;
  end;
end;

procedure possible;
begin
  writeln( 'POSSIBLE' );
  close( input ); close( output );
  halt;
end;

procedure impossible;
begin
  writeln( 'IMPOSSIBLE' );
  close( input ); close( output );
  halt;
end;

procedure solve;
var
  i, j: integer;
  t: tedge;
  w, h: integer;
begin
  for i := 1 to 6 do begin
    read( s[i].w, s[i].h );
    swapmin( s[i].w, s[i].h );
  end;

  for i := 1 to 6 do
    for j := i + 1 to 6 do
      if ( s[j].w > s[i].w ) or ( ( s[j].w = s[i].w ) and ( s[j].h > s[i].h ) ) then begin
        t := s[i]; s[i] := s[j]; s[j] := t;
      end;

  if ( s[1].w <> s[2].w ) or ( s[1].h <> s[2].h ) then impossible;
  if ( s[3].w <> s[4].w ) or ( s[3].h <> s[4].h ) then impossible;
  if ( s[5].w <> s[6].w ) or ( s[5].h <> s[6].h ) then impossible;

  w := s[1].w;
  h := s[1].h;

  if ( w = s[3].w ) and ( h = s[5].w ) and ( s[3].h = s[5].h ) then possible;
  if ( w = s[3].h ) and ( h = s[5].w ) and ( s[3].w = s[5].h ) then possible;
  if ( w = s[3].w ) and ( h = s[5].h ) and ( s[3].h = s[5].w ) then possible;
  if ( w = s[3].h ) and ( h = s[5].h ) and ( s[3].w = s[5].w ) then possible;
  
  if ( h = s[3].w ) and ( w = s[5].w ) and ( s[3].h = s[5].h ) then possible;
  if ( h = s[3].h ) and ( w = s[5].w ) and ( s[3].w = s[5].h ) then possible;
  if ( h = s[3].w ) and ( w = s[5].h ) and ( s[3].h = s[5].w ) then possible;
  if ( h = s[3].h ) and ( w = s[5].h ) and ( s[3].w = s[5].w ) then possible;
  impossible;
end;

begin
  reset(input, fn + '.in');
  rewrite(output, fn + '.out');

  solve;
end.
