#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
bool check(int x)
{
    int sum = 0;
    for (long long i = 1; i < x; i++)
        if (x % i == 0) sum += i;
    return sum == x;
}
int main()
{
    for (int i = 1; i <= 10000000; i++)
    {
        if (check(i))
            printf("%d\n", i);
    }
    return 0;
}
