#include using namespace std; #define reg register typedef long long ll; #define rep(i,a,b) for(reg int i=a,i##end=b;i<=i##end;++i) #define drep(i,a,b) for(reg int i=a,i##end=b;i>=i##end;--i) char IO; int rd(){ int s=0,f=0; while(!isdigit(IO=getchar())) if(IO=='-') f=1; do s=(s<<1)+(s<<3)+(IO^'0'); while(isdigit(IO=getchar())); return f?-s:s; } const int N=4e5+10; int n; int a[N]; int main(){ rep(kase,1,rd()) { n=rd(); int cnt=0; int t=n,c=0; while(t) c+=t%10,t/=10; rep(i,1,c) { if(n%i==0&&c%i==0) a[++cnt]=i; } printf("%d\n",cnt); rep(i,1,cnt) printf("%d%c",a[i],i==cnt?'\n':' '); } }