private static boolean isHot(boolean[][][] hot, int a, int b, int c) {
        for (int l = 1; Math.max(a, Math.max(b,c)) >= l*l; l++)
            if ((c-l*l >= 0 && !hot[a][b][c-l*l]) || (a-l*l >= 0 && !hot[a-l*l][b][c]) || (b-l*l >= 0 && !hot[a][b-l*l][c]))
                return true;
        return false;
    }