#include <iostream> #include<bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n) { for (int j = 2; j <= n; j++) { set<int> s; for (int i = 1; i < j; i++) { if (j % i == 0) { s.insert(i); } } int sum = 0; for (int i : s) { sum += i; } if (sum == j) cout << j <<' '; } } } // 64 位输出请用 printf("%lld")