#include #include #include #include #include #include #include using namespace std; #define ll long long const double eps=1e-8; const ll inf=1e9; const ll mod=1e9+7; const int maxn=1e5+10; int f[1000]; int main() { int t,v,g,ans,vv,i; scanf("%d",&t); while (t--) { scanf("%d",&v); ans=0; vv=v; while (vv) { ans+=vv%10; vv/=10; } g=0; for (i=1;i<=ans;i++) if (v%i==0 && ans%i==0) f[++g]=i; printf("%d\n",g); for (i=1;i<=g;i++) printf("%d%c",f[i],i==g?'\n':' '); } return 0; }