program figure; {$APPTYPE CONSOLE} uses SysUtils; var x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8:integer; a,b,c,d:real; begin assign(input, 'figure.in'); reset(input); read(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8); close(input); assign(output, 'figure.out'); rewrite(output); a:=sqrt(sqr(x1-x2)+sqr(y1-y2)); b:=sqrt(sqr(x3-x4)+sqr(y3-y4)); c:=sqrt(sqr(x5-x6)+sqr(y5-y6)); d:=sqrt(sqr(x7-x8)+sqr(y7-y8)); writeln(a:0:1,' ',b:0:1,' ',c:0:1,' ',d:0:1); if (a=b) and (b=c) and (c=d) then writeln('SQUARE') else if (a=b) and (c=d) or (a=c) and (b=d)then writeln('RECTANGLE') else if (((a=b) and (c=b+c+d ) or (b>=a+c+d) or (c>=a+b+d) or (d>=a+b+c) then writeln('LAMAN') else writeln('TRIANGLE'); close(output); end.