#include<iostream>
#include<conio.h>
using namespace std;
class MaghsumClass
{
	public :
		int x;
		int IsMaghsum(int num)
		{
			if(x % num == 0)
				return 1;
			else
				return 0;
		}
};

int main()
{
	MaghsumClass A;
	int i;
	cout << "Enter a Number : ";
	cin >> A.x;
	for(i = 1; i <= A.x; i++)
		if(A.IsMaghsum(i) == 1)
			cout << i << " ";
	getch();
}

