import std.stdio;

void main() {
    int n;
    readf!"%d"(n);
    foreach (i; 0 .. n) {
        int a, b, c;
        readf!"%d %d %d"(a, b, c);
        writeln(is_right_triangle(a, b, c));
    }
}


bool is_right_triable(int a, int b, int c) {
    return (a * a + b * b) == (c * c);
}