#include int main() { int T; scanf("%d", &T); while (T--) { int N, M, S = 0, Cnt = 0; scanf("%d", &N); M = N; while (M) S += M % 10, M /= 10; for (int x = 1; x <= 81; ++x) if (N % x == 0 && S % x == 0) ++Cnt; printf("%d\n1", Cnt); for (int x = 2; x <= 81; ++x) if (N % x == 0 && S % x == 0) printf(" %d", x); puts(""); } return 0; }