#include using namespace std; int ans[100000],tot; int main(void) { int T; scanf("%d",&T); while (T--) { tot=0; int n; scanf("%d",&n); int s=0; for (int nn=n;nn;nn/=10) s += nn%10; for (int i=1;i<=s;i++) if (s%i==0 && n%i==0) { ans[tot++]=i; } sort(ans,ans+tot); printf("%d\n",tot); for (int i=0;i