#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); map mp; for (ll x = 2; x <= 1'000'000; ++x) { ll y = x * x, z = 2; while (true) { mp[y] = max(mp[y], z); if (y > 1'000'000'000'000 / x) break; y *= x, ++z; } } int q; cin >> q; while (q--) { ll n; cin >> n; cout << (mp.contains(n) ? mp[n] : 1) << '\n'; } return 0; }