// Mugurel Ionut Andreica #include int main() { int N, i, x, y, cnt2, cnt5; long long ans; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d", &x); cnt2 = cnt5 = 0; y = x; while ((y & 1) == 0) { cnt2++; y >>= 1; } while ((y % 5) == 0) { cnt5++; y /= 5; } ans = x; while (cnt5 > cnt2) { ans <<= 2; cnt2 += 2; } printf("%lld\n", ans); } return 0; }