#include int main() { int i, j, k; char flag[100100] = {}; long long prime[20000]; for (i = 2, k = 0; i < 100100; i++) { if (flag[i] != 0) continue; prime[k++] = i; for (j = i; j <= 100100; j += i) flag[j] = 1; } int q, Q, ans[30]; long long x, X; scanf("%d", &Q); for (q = 1; q <= Q; q++) { scanf("%lld", &x); X = x * x + 1; for (i = 0, j = 0; prime[i] * prime[i] <= X; i++) { while (X % prime[i] == 0) { ans[j++] = prime[i]; X /= prime[i]; } } if (X > 1) ans[j++] = X; for (i = 0; i < j; i++) printf("%lld ", ans[i]); printf("\n"); } fflush(stdout); return 0; }