#include #include using namespace std; int a[100000], p; int main() { int t; cin >> t; while (t--) { int n; cin >> n; p = 0; int tmp = n; int cnt = 0; while (tmp) { cnt += tmp % 10; tmp /= 10; } for (int i = 1; i <= n; i = n / (n / i) + 1) { int now = n / i; if (n%now)continue; if (cnt%now == 0)a[++p] = now; } cout << p << endl; for (int i = p; i > 1; i--) { cout << a[i] << " "; } cout << a[1] << endl; } }