#include "Factorization.hpp"
using prime_factor::factorize;

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    int tc;
    std::cin >> tc;
    while (tc--) {
        uint64_t n;
        std::cin >> n;
        std::vector<uint64_t> factors;
        factorize(n, factors);
        std::sort(factors.begin(), factors.end());
        std::cout << factors.size() << " \n"[factors.empty()];
        for (int i = 0; i < factors.size(); i++) {
            std::cout << factors[i] << " \n"[i == factors.size() - 1];
        }
    }
    return 0;
}