import Control.Monad
import Data.List

solve :: String -> Bool
solve s = x * x + y * y == z * z
    where ns = sort $ map read (words s)
          x  = ns !! 0
          y  = ns !! 1
          z  = ns !! 2

main :: IO ()
main = do
    n     <- readLn
    lines <- replicateM n getLine
    mapM_ (print . solve) lines