#include #include #include using namespace std; void solve() { int x; cin >> x; int y = 0; { for (int t = x; t; t /= 10) { y += t % 10; } } vector ans; for (long long i = 1; i * i <= x; ++i) { if (x % i) continue; if (y % i == 0) ans.push_back(i); int j = x / i; if (i != j && y % j == 0) ans.push_back(j); } sort(ans.begin(), ans.end()); cout << ans.size() << endl; for (size_t i = 0; i < ans.size(); ++i) { cout << ans[i] << (i + 1 == ans.size() ? '\n' : ' '); } } int main() { int T; cin >> T; while (T-- > 0) { solve(); } return 0; }