#coing:utf-8


def distance(a,b):

    dst = pow(a,2) + pow(b,2)

    return dst

def isTriangle(lines):

    idxList = [[0,1,2],[1,0,2],[2,0,1]]
    flag = False
    for i in idxList:
        if not flag and pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]):
            flag = True

    return flag

if __name__ == '__main__':

    num = int(input())

    results = []

    for i in range(num):
        lines = [int(item) for item in input().split(" ")]
        results.append(isTriangle(lines))

    for r in results:
        if r:
            print("YES")
        else :
            print("NO") def distance(a,b):

    dst = pow(a,2) + pow(b,2)

    return dst distance dst = pow(a,2) + pow(b,2) dst pow(a,2) + pow(b,2) pow(a,2) pow a 2 pow(b,2) pow b 2 return dst dst a a b b def isTriangle(lines):

    idxList = [[0,1,2],[1,0,2],[2,0,1]]
    flag = False
    for i in idxList:
        if not flag and pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]):
            flag = True

    return flag isTriangle idxList = [[0,1,2],[1,0,2],[2,0,1]] idxList [[0,1,2],[1,0,2],[2,0,1]] [0,1,2] 0 1 2 [1,0,2] 1 0 2 [2,0,1] 2 0 1 flag = False flag False for i in idxList:
        if not flag and pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]):
            flag = True

     i idxList if not flag and pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]):
            flag = True

     not flag and pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]) not flag flag pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]) pow(lines[i[0]],2) pow lines[i[0]] lines i[0] i 0 2 distance(lines[i[1]], lines[i[2]]) distance lines[i[1]] lines i[1] i 1 lines[i[2]] lines i[2] i 2 flag = True flag True return flag flag lines lines if __name__ == '__main__':

    num = int(input())

    results = []

    for i in range(num):
        lines = [int(item) for item in input().split(" ")]
        results.append(isTriangle(lines))

    for r in results:
        if r:
            print("YES")
        else :
            print("NO") __name__ == '__main__' __name__ '__main__' num = int(input()) num int(input()) int input() input results = [] results [] for i in range(num):
        lines = [int(item) for item in input().split(" ")]
        results.append(isTriangle(lines))

     i range(num) range num int(item) for item in input().split(" ") for item in input().split(" ") item input().split(" ") ().split () input split " " for item in input().split(" ") int(item) int item lines = [int(item) for item in input().split(" ")] lines [int(item) for item in input().split(" ")] results.append(isTriangle(lines)) results.append results append isTriangle(lines) isTriangle lines for r in results:
        if r:
            print("YES")
        else :
            print("NO") r results if r:
            print("YES")
        else :
            print("NO") r print("YES") print "YES" print("NO") print "NO" num = int(input()) int(input()) num def distance(a,b):

    dst = pow(a,2) + pow(b,2)

    return dst def distance(a,b):

    dst = pow(a,2) + pow(b,2)

    return dst distance results = [] [] results def isTriangle(lines):

    idxList = [[0,1,2],[1,0,2],[2,0,1]]
    flag = False
    for i in idxList:
        if not flag and pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]):
            flag = True

    return flag def isTriangle(lines):

    idxList = [[0,1,2],[1,0,2],[2,0,1]]
    flag = False
    for i in idxList:
        if not flag and pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]):
            flag = True

    return flag isTriangle lines = [int(item) for item in input().split(" ")] [int(item) for item in input().split(" ")] lines
#coing:utf-8


def distance(a,b):

    dst = pow(a,2) + pow(b,2)

    return dst

def isTriangle(lines):

    idxList = [[0,1,2],[1,0,2],[2,0,1]]
    flag = False
    for i in idxList:
        if not flag and pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]):
            flag = True

    return flag

if __name__ == '__main__':

    num = int(input())

    results = []

    for i in range(num):
        lines = [int(item) for item in input().split(" ")]
        results.append(isTriangle(lines))

    for r in results:
        if r:
            print("YES")
        else :
            print("NO")