#include using namespace std; typedef long long LL; int main() { int T; LL v; scanf("%d", &T); while (T--) { scanf("%I64d", &v); int sum = 0; for (LL t = v; t; t /= 10) sum += t % 10; vector ans; for (int i = 1; i <= sum; ++i) if (sum % i == 0 && v % i == 0) ans.push_back(i); printf("%d\n", (int)ans.size()); for (int i = 0; i < (int)ans.size(); ++i) { if (i) putchar(' '); printf("%d", ans[i]); } puts(""); } return 0; }