#include using namespace std; using ll = long long; int main () { std::vector> rui(40); for (ll x = 2; x <= 1000000; x ++) { ll y = x * x; for (int i = 2; i < 40; i ++) { if (y > (ll)1e12) break; rui[i].push_back(y); y *= x; } } int N; cin >> N; while (N--) { ll x; cin >> x; int ans = 1; for (int i = 2; i < 40; i ++) { if (lower_bound(rui[i].begin(), rui[i].end(), x) != upper_bound(rui[i].begin(), rui[i].end(), x)) { ans = i; } } cout << ans << endl; } }