line_num = int(raw_input())
for n in range(line_num):
	a,b,c = map(int, raw_input().split(" "))
	if a>b:
		if a>c:
			if a*a == b*b + c*c:
				print "YES"
				continue
		else:
			if c*c == a*a + b*b:
				print "YES"
				continue
	else:
		if b>c:
			if b*b == a*a + c*c:
				print "YES"
				continue
		else:
			if c*c == a*a + b*b:
				print "YES"
				continue
	print "NO" line_num = int(raw_input()) line_num int(raw_input()) int raw_input() raw_input for n in range(line_num):
	a,b,c = map(int, raw_input().split(" "))
	if a>b:
		if a>c:
			if a*a == b*b + c*c:
				print "YES"
				continue
		else:
			if c*c == a*a + b*b:
				print "YES"
				continue
	else:
		if b>c:
			if b*b == a*a + c*c:
				print "YES"
				continue
		else:
			if c*c == a*a + b*b:
				print "YES"
				continue
	print "NO" n range(line_num) range line_num a,b,c = map(int, raw_input().split(" ")) a map(int, raw_input().split(" ")) map int raw_input().split(" ") ().split () raw_input split " " b c if a>b:
		if a>c:
			if a*a == b*b + c*c:
				print "YES"
				continue
		else:
			if c*c == a*a + b*b:
				print "YES"
				continue
	else:
		if b>c:
			if b*b == a*a + c*c:
				print "YES"
				continue
		else:
			if c*c == a*a + b*b:
				print "YES"
				continue
	 a>b a b if a>c:
			if a*a == b*b + c*c:
				print "YES"
				continue
		else:
			if c*c == a*a + b*b:
				print "YES"
				continue
	 a>c a c if a*a == b*b + c*c:
				print "YES"
				continue
		 a*a == b*b + c*c a*a a a b*b + c*c b*b b b c*c c c print continue if c*c == a*a + b*b:
				print "YES"
				continue
	 c*c == a*a + b*b c*c c c a*a + b*b a*a a a b*b b b print continue if b>c:
			if b*b == a*a + c*c:
				print "YES"
				continue
		else:
			if c*c == a*a + b*b:
				print "YES"
				continue
	 b>c b c if b*b == a*a + c*c:
				print "YES"
				continue
		 b*b == a*a + c*c b*b b b a*a + c*c a*a a a c*c c c print continue if c*c == a*a + b*b:
				print "YES"
				continue
	 c*c == a*a + b*b c*c c c a*a + b*b a*a a a b*b b b print continue print b,c = map(int, raw_input().split(" ")) map(int, raw_input().split(" ")) b line_num = int(raw_input()) int(raw_input()) line_num a,b,c = map(int, raw_input().split(" ")) map(int, raw_input().split(" ")) a c = map(int, raw_input().split(" ")) map(int, raw_input().split(" ")) c
line_num = int(raw_input())
for n in range(line_num):
	a,b,c = map(int, raw_input().split(" "))
	if a>b:
		if a>c:
			if a*a == b*b + c*c:
				print "YES"
				continue
		else:
			if c*c == a*a + b*b:
				print "YES"
				continue
	else:
		if b>c:
			if b*b == a*a + c*c:
				print "YES"
				continue
		else:
			if c*c == a*a + b*b:
				print "YES"
				continue
	print "NO"