// DIVGAME // Game of Divisors // Author: Constantine Sokol // Complexity : O( T * sqrt( N ) ) // Expected Verdict: AC #include #include #define mp make_pair #define pb push_back using namespace std; bool fun( int n ) { if ( n == 2 ) return true; if ( n == 16 ) return false; if ( n == 17 ) return true; if ( n == 34 ) return false; if ( n == 289 ) return false; for ( int i = 2; i * i <= n; i++ ) if ( n % i == 0 ) return true; return false; } int main (int argc, const char * argv[]) { int test; scanf("%d", &test); while ( test-- ) { int n; scanf("%d", &n); if ( fun( n ) ) puts("Mike"); else puts("Tom"); } return 0; }