#include using namespace std; typedef long long ll; const int MAXN=100005; int n; int main() { #ifndef ONLINE_JUDGE freopen("code.in","r",stdin); //freopen("code.out","w",stdout); #endif int T,x; cin>>T; while(T--) { cin>>x; int s=0; for(int i=x;i;i/=10)s+=i%10; int cnt=0; for(int j=1;j<=s;j++) if(!(s%j) && !(x%j))++cnt; bool flag=0; printf("%d\n",cnt); for(int j=1;j<=s;j++) if(!(s%j) && !(x%j)) { if(flag)printf(" %d",j); else {printf("%d",j);flag=1;} } printf("\n"); } return 0; }