program figure; {$APPTYPE CONSOLE} uses math; var x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8:integer; a,b,c,d:double; begin assign(input, 'input.dat'); reset(input); read(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8); close(input); assign(output, 'output.ans'); rewrite(output); a:=sqrt(power(x1-x2,2)+power(y1-y2,2)); b:=sqrt(power(x3-x4,2)+power(y3-y4,2)); c:=sqrt(power(x5-x6,2)+power(y5-y6,2)); 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>d)and (cc) and (dd)and(bb) and (dc)and(bb)and (cd)and (aa)and (dc)and (aa)and (cb)and (aa)and (b=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.