Read problems statements in Mandarin Chinese , Russian and Vietnamese as well. 

Triangle classification is an important problem in modern mathematics. Mathematicians have developed many criteria according to which a triangle can be classified. In this problem, you will be asked to classify some triangles according to their sides and angles.

According to their measure, angles may be:

Acute — an angle that is less than 90 degrees
Right — a 90-degrees angle
Obtuse — an angle that is greater than 90 degrees
  
According to their sides, triangles may be:

Scalene — all sides are different
Isosceles — exactly two sides are equal
  
According to their angles, triangles may be:
  
Acute — all angles are acute
Right — one angle is right
Obtuse — one angle is obtuse
Triangles with three equal sides (equilateral triangles) will not appear in the test data.

The triangles formed by three collinear points are not considered in this problem. In order to classify a triangle, you should use only the adjactives from the statement. There is no triangle which could be described in two different ways according to the classification characteristics considered above.

------ Input ------ 

The first line of input contains an integer SUBTASK_{ID} denoting the subtask id this input belongs to.
The second line of input contains an integer T denoting the number of test cases. The description of T test cases follows.

The only line of each test case contains six integers x_{1}, y_{1}, x_{2}, y_{2}, x_{3} and y_{3} denoting Cartesian coordinates of points, that form the triangle to be classified.

It is guaranteed that the points are non-collinear.

------ Output ------ 

For each test case, output a single line containing the classification of the given triangle.
If SUBTASK_{ID} equals 1, then the classification should follow the "Side classification starting with a capital letter> triangle" format. 
If SUBTASK_{ID} equals 2, then the classification should follow the "Side classification starting with a capital letter> angle classification> triangle" format.
Please, check out the samples section to better understand the format of the output.

------ Constraints ------ 

$1 ≤ T ≤ 60$
$|x_{i}|, |y_{i}| ≤ 100$
$Subtask 1 (50 points): no additional constraints$
$Subtask 2 (50 points): no additional constraints$

------ Note ------ 

The first test of the first subtask and the first test of the second subtask are the example tests (each in the corresponding subtask). It's made for you to make sure that your solution produces the same verdict both on your machine and our server.

------ Tip ------ 

Consider using the following condition in order to check whether two floats or doubles A and B are equal instead of traditional A == B: |A - B| < 10^{-6}.

----- Sample Input 1 ------ 
1
2
0 0 1 1 1 2
3 0 0 4 4 7
----- Sample Output 1 ------ 
Scalene triangle
Isosceles triangle
----- explanation 1 ------ 

----- Sample Input 2 ------ 
2
6
0 0 4 1 1 3
0 0 1 0 1 2
0 0 1 1 1 2
0 0 2 1 1 2
3 0 0 4 4 7
0 0 2 1 4 0
----- Sample Output 2 ------ 
Scalene acute triangle
Scalene right triangle
Scalene obtuse triangle
Isosceles acute triangle
Isosceles right triangle
Isosceles obtuse triangle
----- explanation 2 ------

Source: codechef | Difficulty: MEDIUM
Tags: Geometry

Ad-hoc


Solutions:
def sub1():
	for i in range(int(input())):
		(x1, y1, x2, y2, x3, y3) = map(int, input().split())
		l1 = (x2 - x1) ** 2 + (y2 - y1) ** 2
		l2 = (x2 - x3) ** 2 + (y2 - y3) ** 2
		l3 = (x3 - x1) ** 2 + (y3 - y1) ** 2
		if l1 == l2 or l2 == l3 or l3 == l1:
			print('Isosceles triangle')
			continue
		print('Scalene triangle')

def sub2():
	for i in range(int(input())):
		(x1, y1, x2, y2, x3, y3) = map(int, input().split())
		sides_comp = 'Scalene'
		angle_comp = 'obtuse'
		l1 = (x2 - x1) ** 2 + (y2 - y1) ** 2
		l2 = (x2 - x3) ** 2 + (y2 - y3) ** 2
		l3 = (x3 - x1) ** 2 + (y3 - y1) ** 2
		if l1 == l2 or l2 == l3 or l3 == l1:
			sides_comp = 'Isosceles'
		if l3 == l1 + l2 or l1 == l2 + l3 or l2 == l1 + l3:
			angle_comp = 'right'
		if l1 < l2 + l3 and l2 < l3 + l1 and (l3 < l2 + l1):
			angle_comp = 'acute'
		print(f'{sides_comp} {angle_comp} triangle')
if input() == '2':
	sub2()
else:
	sub1()


def dist(x, y, a, b):
	return (x - a) ** 2 + (y - b) ** 2
subtask_id = int(input())
s = 'triangle'
if subtask_id == 1:
	for _ in range(int(input())):
		(x1, y1, x2, y2, x3, y3) = map(int, input().split())
		a1 = dist(x1, y1, x2, y2)
		a2 = dist(x1, y1, x3, y3)
		a3 = dist(x2, y2, x3, y3)
		if a1 != a2 and a2 != a3 and (a3 != a1):
			s1 = 'Scalene'
		else:
			s1 = 'Isosceles'
		print(s1, s)
else:
	for _ in range(int(input())):
		(x1, y1, x2, y2, x3, y3) = map(int, input().split())
		a1 = dist(x1, y1, x2, y2)
		a2 = dist(x1, y1, x3, y3)
		a3 = dist(x2, y2, x3, y3)
		peri = a1 + a2 + a3
		mxm = max(a1, a2, a3)
		if a1 != a2 and a2 != a3 and (a3 != a1):
			s1 = 'Scalene'
		else:
			s1 = 'Isosceles'
		if 2 * mxm == peri:
			s3 = 'right'
		elif 2 * mxm > peri:
			s3 = 'obtuse'
		else:
			s3 = 'acute'
		print(s1, s3, s)


d = int(input())
for nuni in range(int(input())):
	(x1, y1, x2, y2, x3, y3) = map(int, input().split())
	a1 = (x1 - x2) ** 2 + (y1 - y2) ** 2
	a2 = (x3 - x2) ** 2 + (y3 - y2) ** 2
	a3 = (x1 - x3) ** 2 + (y1 - y3) ** 2
	mx = max(a1, a2, a3)
	sm = a1 + a2 + a3
	s3 = 'triangle'
	if d == 1:
		if a1 == a2 or a2 == a3 or a3 == a1:
			print('Isosceles triangle')
		else:
			print('Scalene triangle')
	else:
		if a1 == a2 or a2 == a3 or a3 == a1:
			s1 = 'Isosceles'
		else:
			s1 = 'Scalene'
		if mx == sm - mx:
			s2 = 'right'
		elif mx > sm - mx:
			s2 = 'obtuse'
		else:
			s2 = 'acute'
		print(s1, s2, s3)


import math

def dis(x1, y1, x2, y2):
	d = (x1 - x2) ** 2 + (y1 - y2) ** 2
	return d
sid = int(input())
T = int(input())
for tc in range(T):
	(x1, y1, x2, y2, x3, y3) = map(int, input().split(' '))
	d1 = dis(x1, y1, x2, y2)
	d2 = dis(x1, y1, x3, y3)
	d3 = dis(x2, y2, x3, y3)
	t = ''
	a = ''
	M = max(d1, d2, d3)
	sumd = d1 + d2 + d3
	if d1 != d2 and d2 != d3 and (d1 != d3):
		t = 'Scalene'
	else:
		t = 'Isosceles'
	if sid == 1:
		print(t, 'triangle')
	elif sid == 2:
		if M == sumd - M:
			a = 'right'
		elif M > sumd - M:
			a = 'obtuse'
		else:
			a = 'acute'
		print(t, a, 'triangle')


def angle(d1, d2, d3):
	arr = [d1, d2, d3]
	arr.sort()
	if arr[2] > arr[0] + arr[1]:
		return 'obtuse'
	elif arr[2] < arr[0] + arr[1]:
		return 'acute'
	else:
		return 'right'

def side(d1, d2, d3):
	arr = [d1, d2, d3]
	arr.sort()
	if d1 != d2 and d2 != d3 and (d3 != d1):
		return 'Scalene'
	else:
		return 'Isosceles'
sd = int(input())
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2, x3, y3) = map(int, input().split())
	d1 = (x1 - x2) ** 2 + (y1 - y2) ** 2
	d2 = (x1 - x3) ** 2 + (y1 - y3) ** 2
	d3 = (x2 - x3) ** 2 + (y2 - y3) ** 2
	if sd == 1:
		ans = side(d1, d2, d3) + ' triangle'
	else:
		ans = side(d1, d2, d3) + ' ' + angle(d1, d2, d3) + ' triangle'
	print(ans)


import math

def subtask1(inputs):
	ans = []
	for i in range(inputs):
		coordinates = input()
		coordinates = coordinates.split(' ')
		A = (int(coordinates[0]), int(coordinates[1]))
		B = (int(coordinates[2]), int(coordinates[3]))
		C = (int(coordinates[4]), int(coordinates[5]))
		AB = math.sqrt((B[0] - A[0]) ** 2 + (B[1] - A[1]) ** 2)
		BC = math.sqrt((B[0] - C[0]) ** 2 + (B[1] - C[1]) ** 2)
		AC = math.sqrt((C[0] - A[0]) ** 2 + (C[1] - A[1]) ** 2)
		if AB == BC or BC == AC or AC == AB:
			ans.append('Isosceles triangle')
		else:
			ans.append('Scalene triangle')
	for triangle in ans:
		print(triangle)

def subtask2(inputs):
	ans = []
	for i in range(inputs):
		coordinates = input()
		coordinates = coordinates.split(' ')
		A = (int(coordinates[0]), int(coordinates[1]))
		B = (int(coordinates[2]), int(coordinates[3]))
		C = (int(coordinates[4]), int(coordinates[5]))
		AB = math.sqrt((B[0] - A[0]) ** 2 + (B[1] - A[1]) ** 2)
		BC = math.sqrt((B[0] - C[0]) ** 2 + (B[1] - C[1]) ** 2)
		AC = math.sqrt((C[0] - A[0]) ** 2 + (C[1] - A[1]) ** 2)
		str = ''
		if AB == BC or BC == AC or AC == AB:
			str += 'Isosceles '
		else:
			str += 'Scalene '
		str += pythagoras(AB, BC, AC)
		str += ' triangle'
		ans.append(str)
	for triangle in ans:
		print(triangle)

def pythagoras(a, b, c):
	A = a ** 2
	B = b ** 2
	C = c ** 2
	if equality(A, B + C) or equality(B, A + C) or equality(C, A + B):
		return 'right'
	elif A > B + C or B > A + C or C > B + A:
		return 'obtuse'
	return 'acute'

def equality(a, b):
	if math.fabs(a - b) < 10 ** (-6):
		return True
	return False
subtask_id = int(input())
if subtask_id == 1:
	subtask1(int(input()))
else:
	subtask2(int(input()))


def dist(x1, x2, y1, y2):
	d = ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5
	return d

def main():
	si = int(input())
	t = int(input())
	for z in range(t):
		(x1, y1, x2, y2, x3, y3) = map(int, input().split())
		d1 = dist(x1, x2, y1, y2)
		d2 = dist(x1, x3, y1, y3)
		d3 = dist(x3, x2, y3, y2)
		if d1 == d2 or d2 == d3 or d1 == d3:
			side = 'Isosceles'
		else:
			side = 'Scalene'
		l = [d1, d2, d3]
		l.sort()
		l1 = (x2 - x1, y2 - y1, x3 - x1, y3 - y1, x3 - x2, y3 - y2)
		if l1[2] * l1[0] + l1[3] * l1[1] == 0 or l1[4] * l1[0] + l1[5] * l1[1] == 0 or l1[4] * l1[2] + l1[5] * l1[3] == 0:
			angle = 'right'
		elif l[0] ** 2 + l[1] ** 2 - l[2] ** 2 > 0.0:
			angle = 'acute'
		else:
			angle = 'obtuse'
		if si == 1:
			print(side + ' triangle')
		if si == 2:
			print(side + ' ' + angle + ' triangle')
main()


id = int(input())
t = int(input())
for i in range(t):
	(x1, y1, x2, y2, x3, y3) = map(int, input().split())
	d1 = (x1 - x2) ** 2 + (y1 - y2) ** 2
	d2 = (x1 - x3) ** 2 + (y1 - y3) ** 2
	d3 = (x2 - x3) ** 2 + (y2 - y3) ** 2
	angle = ''
	length = ''
	arr = [d1, d2, d3]
	arr.sort()
	if arr[2] > arr[0] + arr[1]:
		angle = 'obtuse'
	elif arr[2] < arr[0] + arr[1]:
		angle = 'acute'
	else:
		angle = 'right'
	if d1 != d2 and d2 != d3 and (d3 != d1):
		length = 'Scalene'
	else:
		length = 'Isosceles'
	if id == 1:
		print(length + ' triangle')
	else:
		print(length + ' ' + angle + ' triangle')


idsub = int(input())
import math

def dist(x1, y1, x2, y2):
	return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)

def side(x1, y1, x2, y2, x3, y3):
	a = dist(x1, y1, x2, y2)
	b = dist(x2, y2, x3, y3)
	c = dist(x1, y1, x3, y3)
	if a == b or b == c or c == a:
		return 'Isosceles'
	else:
		return 'Scalene'

def vectorize(x1, y1, x2, y2):
	return [x2 - x1, y2 - y1]

def angle(x1, y1, x2, y2, x3, y3):
	a = vectorize(x2, y2, x1, y1)
	b = vectorize(x2, y2, x3, y3)
	return a[0] * b[0] + a[1] * b[1]

def angclass(x1, y1, x2, y2, x3, y3):
	if angle(x1, y1, x2, y2, x3, y3) == 0 or angle(x2, y2, x3, y3, x1, y1) == 0 or angle(x3, y3, x1, y1, x2, y2) == 0:
		return 'right'
	elif angle(x1, y1, x2, y2, x3, y3) < 0 or angle(x2, y2, x3, y3, x1, y1) < 0 or angle(x3, y3, x1, y1, x2, y2) < 0:
		return 'obtuse'
	else:
		return 'acute'
for i in range(int(input())):
	(x1, y1, x2, y2, x3, y3) = [int(i) for i in input().split()]
	if idsub == 1:
		s = side(x1, y1, x2, y2, x3, y3)
		print(s, 'triangle')
	else:
		print(side(x1, y1, x2, y2, x3, y3), angclass(x1, y1, x2, y2, x3, y3), 'triangle')


subtask_id = int(input())
t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	distance_list = [0, 0, 0]
	distance_list[0] = pow(a[0] - a[2], 2) + pow(a[1] - a[3], 2)
	distance_list[1] = pow(a[2] - a[4], 2) + pow(a[3] - a[5], 2)
	distance_list[2] = pow(a[4] - a[0], 2) + pow(a[5] - a[1], 2)
	triangle_side_type = ''
	triangle_angle_type = ''
	if distance_list[0] == distance_list[1] or distance_list[1] == distance_list[2] or distance_list[2] == distance_list[0]:
		triangle_side_type = 'Isosceles'
	else:
		triangle_side_type = 'Scalene'
	if subtask_id is 1:
		print(f'{triangle_side_type} triangle')
	elif subtask_id is 2:
		cosine_angles_list = [0.0, 0.0, 0.0]
		cosine_angles_list[0] = (distance_list[0] + distance_list[1] - distance_list[2]) / (2 * pow(distance_list[0], 0.5) * pow(distance_list[1], 0.5))
		cosine_angles_list[1] = (distance_list[1] + distance_list[2] - distance_list[0]) / (2 * pow(distance_list[1], 0.5) * pow(distance_list[2], 0.5))
		cosine_angles_list[2] = (distance_list[2] + distance_list[0] - distance_list[1]) / (2 * pow(distance_list[2], 0.5) * pow(distance_list[0], 0.5))
		for k in range(3):
			if cosine_angles_list[k] < -1 * pow(10, -6):
				triangle_angle_type = 'obtuse'
				break
			elif pow(10, -6) > cosine_angles_list[k] > -1 * pow(10, -6):
				triangle_angle_type = 'right'
				break
			else:
				triangle_angle_type = 'acute'
		print(f'{triangle_side_type} {triangle_angle_type} triangle')


def length(x1, y1, x2, y2):
	temp1 = (x1 - x2) ** 2
	temp2 = (y1 - y2) ** 2
	return temp1 + temp2

def classify_angle(sides):
	longest = max(sides)
	sides.remove(longest)
	temp1 = longest
	temp2 = sides[0] + sides[1]
	if temp1 > temp2:
		print('obtuse', end=' ')
	elif temp1 == temp2:
		print('right', end=' ')
	else:
		print('acute', end=' ')

def classify_size(sides):
	unique = set(sides)
	if len(unique) == 3:
		print('Scalene', end=' ')
	else:
		print('Isosceles', end=' ')
subtask = int(input())
for i in range(int(input())):
	(x1, y1, x2, y2, x3, y3) = map(int, input().split(' '))
	sides = [0, 0, 0]
	sides[0] = length(x1, y1, x2, y2)
	sides[1] = length(x2, y2, x3, y3)
	sides[2] = length(x1, y1, x3, y3)
	classify_size(sides)
	if subtask == 2:
		classify_angle(sides)
	print('triangle')


SUBTASK_ID = int(input())
for _ in range(int(input())):
	(x1, y1, x2, y2, x3, y3) = [int(s) for s in input().split()]
	(Δx1, Δy1, Δx2, Δy2, Δx3, Δy3) = (x2 - x1, y2 - y1, x3 - x2, y3 - y2, x1 - x3, y1 - y3)
	(Δ1, Δ2, Δ3) = (Δx1 * Δx1 + Δy1 * Δy1, Δx2 * Δx2 + Δy2 * Δy2, Δx3 * Δx3 + Δy3 * Δy3)
	if SUBTASK_ID == 1:
		if Δ1 == Δ2 or Δ2 == Δ3 or Δ3 == Δ1:
			print('Isosceles triangle')
		else:
			print('Scalene triangle')
	else:
		if Δ1 == Δ2 or Δ2 == Δ3 or Δ3 == Δ1:
			T = 'Isosceles'
		else:
			T = 'Scalene'
		if Δ1 + Δ2 < Δ3 or Δ2 + Δ3 < Δ1 or Δ3 + Δ1 < Δ2:
			print(T, 'obtuse triangle')
		elif Δ1 + Δ2 == Δ3 or Δ2 + Δ3 == Δ1 or Δ3 + Δ1 == Δ2:
			print(T, 'right triangle')
		else:
			print(T, 'acute triangle')


id = int(input())
n = int(input())
for i in range(n):
	d = []
	(x1, y1, x2, y2, x3, y3) = map(int, input().split())
	d.append((x1 - x2) ** 2 + (y1 - y2) ** 2)
	d.append((x3 - x2) ** 2 + (y3 - y2) ** 2)
	d.append((x3 - x1) ** 2 + (y3 - y1) ** 2)
	d.sort()
	if d[0] == d[1] or d[1] == d[2]:
		side = 'Isosceles'
	else:
		side = 'Scalene'
	if d[0] + d[1] < d[2]:
		angle = 'obtuse'
	elif d[0] + d[1] == d[2]:
		angle = 'right'
	elif d[0] + d[1] > d[2]:
		angle = 'acute'
	else:
		angle = ''
	if id == 1:
		print(side, 'triangle')
	else:
		print(side, angle, 'triangle')


import math
SUBTASK_ID = int(input())
I = int(input())

class operations:

	def __init__(self, list):
		self.seg1 = ((list[0] - list[2]) ** 2 + (list[1] - list[3]) ** 2) ** 0.5
		self.seg2 = ((list[2] - list[4]) ** 2 + (list[3] - list[5]) ** 2) ** 0.5
		self.seg3 = ((list[0] - list[4]) ** 2 + (list[1] - list[5]) ** 2) ** 0.5

	def segments(self):
		if self.seg1 == self.seg2 or self.seg2 == self.seg3 or self.seg1 == self.seg3:
			rst = 'Isosceles'
		else:
			rst = 'Scalene'
		return rst

	def angles(self):
		angels3 = int(math.acos((self.seg1 ** 2 + self.seg2 ** 2 - self.seg3 ** 2) / (2 * self.seg1 * self.seg2)) * 57.2958)
		angels2 = int(math.acos((self.seg1 ** 2 + self.seg3 ** 2 - self.seg2 ** 2) / (2 * self.seg1 * self.seg3)) * 57.2958)
		angels1 = int(math.acos((self.seg2 ** 2 + self.seg3 ** 2 - self.seg1 ** 2) / (2 * self.seg2 * self.seg3)) * 57.2958)
		return (angels1, angels2, angels3)
for _ in range(I):
	Points = list(map(int, input().split()))
	op = operations(Points)
	if SUBTASK_ID == 1:
		print(str(op.segments()) + ' triangle')
	elif SUBTASK_ID == 2:
		(a1, a2, a3) = op.angles()
		if abs(a1) < 90 and abs(a2) < 90 and (abs(a3) < 90):
			print(str(op.segments()) + ' acute ' + 'triangle')
		elif abs(a1) == 90 or abs(a2) == 90 or abs(a3) == 90:
			print(str(op.segments()) + ' right ' + 'triangle')
		elif abs(a1) > 90 or abs(a2) > 90 or abs(a3) > 90:
			print(str(op.segments()) + ' obtuse ' + 'triangle')


import math
subtask_id = int(input())
t = int(input())
for tc in range(t):
	coord = list(map(int, input().split(' ')))
	a = math.sqrt((coord[2] - coord[0]) ** 2 + (coord[3] - coord[1]) ** 2)
	b = math.sqrt((coord[4] - coord[2]) ** 2 + (coord[5] - coord[3]) ** 2)
	c = math.sqrt((coord[4] - coord[0]) ** 2 + (coord[5] - coord[1]) ** 2)
	triangle = 'Scalene '
	if abs(a - b) < 1e-06 or abs(a - c) < 1e-06 or abs(b - c) < 1e-06:
		triangle = 'Isosceles '
	if subtask_id == 2:
		teta_1 = math.acos((a ** 2 + b ** 2 - c ** 2) / (2 * a * b)) * 57.2958
		teta_2 = math.acos((a ** 2 + c ** 2 - b ** 2) / (2 * a * c)) * 57.2958
		teta_3 = math.acos((b ** 2 + c ** 2 - a ** 2) / (2 * c * b)) * 57.2958
		if teta_1 - 90.0 < 0.0 and teta_2 - 90.0 < 0.0 and (teta_3 - 90.0 < 0.0):
			triangle = triangle + 'acute '
		elif abs(teta_1 - 90.0) < 0.001 or abs(teta_2 - 90.0) < 0.001 or abs(teta_3 - 90.0) < 0.001:
			triangle = triangle + 'right '
		else:
			triangle = triangle + 'obtuse '
	print(triangle + 'triangle')


listInput = lambda : list(map(int, input().split(' ')))
mapInput = lambda : map(int, input().split(' '))
import math
sub_id = int(input())
for _ in range(int(input())):
	res = 'Scalene'
	s = []
	(x1, y1, x2, y2, x3, y3) = mapInput()
	s.append((x2 - x1) ** 2 + (y2 - y1) ** 2)
	s.append((x3 - x1) ** 2 + (y3 - y1) ** 2)
	s.append((x2 - x3) ** 2 + (y2 - y3) ** 2)
	s.sort()
	if s[0] == s[1] or s[1] == s[2]:
		res = 'Isosceles'
	if sub_id > 1:
		if s[0] + s[1] == s[2]:
			res = res + ' right'
		elif s[0] + s[1] < s[2]:
			res = res + ' obtuse'
		else:
			res = res + ' acute'
	print(res, 'triangle')


s = int(input())
t = int(input())
for i in range(t):
	n = [int(x) for x in input().split()]
	a = ((n[0] - n[2]) ** 2 + (n[1] - n[3]) ** 2) ** 0.5
	b = ((n[0] - n[4]) ** 2 + (n[1] - n[5]) ** 2) ** 0.5
	c = ((n[4] - n[2]) ** 2 + (n[5] - n[3]) ** 2) ** 0.5
	side = [a, b, c]
	ma = max(side)
	side.remove(ma)
	if s == 1:
		ans1 = ''
		if a == b or b == c or a == c:
			ans1 = 'Isosceles triangle'
		else:
			ans1 = 'Scalene triangle'
		print(ans1)
	if s == 2:
		ans2 = ''
		x = side[0]
		y = side[1]
		e = x ** 2 + y ** 2
		ans1 = ''
		if a == b or b == c or a == c:
			ans1 = 'Isosceles'
		else:
			ans1 = 'Scalene'
		if abs(ma ** 2 - e) < 10 ** (-6):
			ans2 = 'right triangle'
		elif side[0] ** 2 + side[1] ** 2 < ma ** 2:
			ans2 = 'obtuse triangle'
		elif side[0] ** 2 + side[1] ** 2 > ma ** 2:
			ans2 = 'acute triangle'
		print(ans1, ans2)


ST_id = int(input())
for _ in range(int(input())):
	side_d = []
	A = list(map(int, input().split()))
	A.append(A[0])
	A.append(A[1])
	for i in range(0, 6, 2):
		side_d.append((A[i] - A[i + 2]) * (A[i] - A[i + 2]) + (A[i + 1] - A[i + 3]) * (A[i + 1] - A[i + 3]))
	side_d.sort()
	if side_d[0] == side_d[1] or side_d[1] == side_d[2]:
		ans = 'Isosceles'
	else:
		ans = 'Scalene'
	if ST_id > 1:
		if side_d[0] + side_d[1] == side_d[2]:
			angle = 'right'
		elif side_d[0] + side_d[1] < side_d[2]:
			angle = 'obtuse'
		else:
			angle = 'acute'
		ans = ans + ' ' + angle
	print(ans, 'triangle')


id_ = int(input())
tests = int(input())
for i in range(tests):
	arr = list(map(int, input().split()))
	(a, b, c) = (0, 0, 0)
	a = abs(arr[1] - arr[3]) ** 2 + abs(arr[0] - arr[2]) ** 2
	b = abs(arr[2] - arr[4]) ** 2 + abs(arr[3] - arr[5]) ** 2
	c = abs(arr[1] - arr[5]) ** 2 + abs(arr[0] - arr[4]) ** 2
	ans = ''
	if a == b or b == c or c == a:
		ans += 'Isosceles '
	else:
		ans += 'Scalene '
	if id_ == 2:
		if a + b == c or b + c == a or c + a == b:
			ans += 'right '
		elif a + b < c or b + c < a or c + a < b:
			ans += 'obtuse '
		else:
			ans += 'acute '
	ans += 'triangle'
	print(ans)


ST_id = int(input())
for _ in range(int(input())):
	side_d = []
	(x1, y1, x2, y2, x3, y3) = map(int, input().split())
	side_d.append((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
	side_d.append((x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2))
	side_d.append((x3 - x1) * (x3 - x1) + (y3 - y1) * (y3 - y1))
	side_d.sort()
	if side_d[0] == side_d[1] or side_d[1] == side_d[2]:
		ans = 'Isosceles'
	else:
		ans = 'Scalene'
	if ST_id > 1:
		if side_d[0] + side_d[1] == side_d[2]:
			angle = 'right'
		elif side_d[0] + side_d[1] < side_d[2]:
			angle = 'obtuse'
		else:
			angle = 'acute'
		ans = ans + ' ' + angle
	print(ans, 'triangle')


def angle_check(AB, AC, BC):
	li = [AB, AC, BC]
	li.sort()
	if li[2] == li[0] + li[1]:
		return 'right'
	elif li[2] < li[0] + li[1]:
		return 'acute'
	elif li[2] > li[0] + li[1]:
		return 'obtuse'

def side(AB, AC, BC):
	if AB != AC and AB != BC and (AC != BC):
		return 'Scalene'
	elif AB == AC or AB == BC or AC == BC:
		return 'Isosceles'

def side_check(x1, y1, x2, y2, x3, y3, condition):
	AB = abs(x2 - x1) ** 2 + abs(y2 - y1) ** 2
	AC = abs(x3 - x1) ** 2 + abs(y3 - y1) ** 2
	BC = abs(x3 - x2) ** 2 + abs(y3 - y2) ** 2
	if condition == 1:
		print(side(AB, AC, BC), ' triangle')
	else:
		print(side(AB, AC, BC), angle_check(AB, AC, BC), ' triangle')
condition = int(input())
for _ in range(int(input())):
	(x1, y1, x2, y2, x3, y3) = map(int, input().split())
	side_check(x1, y1, x2, y2, x3, y3, condition)