#include #include #include #include #include #include #include #include using namespace std; #define Int register int void read (int &x) { x = 0;char c = getchar();int f = 1; while (c < '0' || c > '9'){if (c == '-') f = -f;c = getchar();} while (c >= '0' && c <= '9'){x = (x << 3) + (x << 1) + c - '0';c = getchar();} x *= f;return ; } void write (int x) { if (x < 0){x = -x;putchar ('-');} if (x > 9) write (x / 10); putchar (x % 10 + '0'); } int Sum (int x) { int tot = 0; while (x) { tot += x % 10; x /= 10; } return tot; } void Work (int x) { vector ans; int tot = Sum (x); for (Int i = 1;i <= tot;++ i) if (x % i == 0) if (tot % i == 0) ans.push_back(i); write (ans.size()),putchar ('\n'); if (!ans.size()) return ; write (ans[0]); for (Int i = 1;i < ans.size();++ i) putchar (' '),write (ans[i]); putchar ('\n'); return ; } signed main() { int times; read (times); while (times --) { int x; read (x); Work (x); } return 0; }