a,b,c=input().split() a,b,c=int(a),int(b),int(c) if a*a<b*c: print("RECTANGLE") elif a*a==b*c: print("SAME") else: print("SQUARE")