#include #include #include #include #include #include #include #include #include typedef vector VI; typedef vector > VVI; typedef vector VS; typedef vector > VVS; typedef signed long long i64; typedef unsigned long long u64; main() { int i, j, k, x, y, z, n; int prob; for( scanf( " %d", &prob ); prob; prob-- ) { scanf( " %d", &n ); int best = 1000000000; for( x = 1; x <= n; x++ ) if( n%x == 0 ) for( y = 1; y <= n/x; y++ ) if( (n/x)%y == 0 ) for( z = 1; z <= n/x/y; z++ ) if( n == x*y*z ) best