n = gets.to_i
n.times do
  line = gets
  line = line.split()
  for i in 0..2 do
    line[i] = line[i].to_i**2
  end

  if (line[0] == line[1] + line[2] or
      line[1] == line[2] + line[0] or
      line[2] == line[0] + line[1]) then
    puts "OK"
  else
    puts "NO"
  end
end