#include using namespace std; int main() { int T; cin >> T; long long n; for (int i = 0; i < T; i++) { cin >> n; int sum = 0; long long t = n; while (true) { sum += (t % 10); if (t < 10) break; t /= 10; } bool first = true; long long count = 0; for (int k = 1; k <= sum; k++) if (sum%k == 0 && n%k == 0) count++; cout << count << endl; for (int k = 1; k<=sum; k++) { if (sum%k == 0 && n%k == 0) { if (first) { cout << k; first = false; } else cout << " " << k; } } cout << endl; } return 0; }