#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
#define mems(p) memset(p,-1,sizeof(p))
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define nl "\n"

const int mxN = 1e5;
const ll MOD = 1e9 + 7;

void fast()
{ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

ll gcd(ll a, ll b) {
	return b ? gcd(b, a%b) : a;
}

vector<ll> factorial;

ll expo(ll x, ll exp) {
    if (exp <= 0) return 1;
    ll tmp = (x*x)% MOD;
    if (exp%2) {
        return (expo(tmp, exp/2) * x) % MOD;
    }
    return (expo(tmp, exp/2)) % MOD;
}

ll choice(ll n, ll r) {
	if (n < r) return 0;
    ll numer = factorial[n];
    ll denom = (factorial[r] * factorial[n-r]) % MOD;
    return numer * expo(denom, MOD - 2) % MOD;
}

int main() {
	fast();
	ll n;
	cin>>n;
	ll ans = 0;
	vector<ll> fromdown, fromup;
	for (ll i = 1; i * i <= n; ++i)
	{
		if (n%i == 0) {
			fromdown.pb(i);
			if (n/i != i) fromup.pb(n/i);
		}
	}
	for (ll x : fromdown) {
		cout<<x<<nl;
	}
	for (int i = (int)fromup.size() - 1; i >= 0; --i) {
		cout<<fromup[i]<<nl;
	}




}
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; typedef long double ld; typedef vector <int> vi; typedef vector <ll> vll; typedef vector <string> vS; typedef vector <vector <int>> vv; typedef map<int, int> mi; typedef map<string, int> ms; typedef map<char, int> mc; typedef string S; typedef map <ll, ll> ml; typedef map <int, bool> mb; typedef vector <ld> vld; typedef vector <bool> vb; typedef map<ll, ll> mll;
#define FOR(i,N) for(int i = 0 ; i < N;i++)
#define eFOR(i,a,b) for(int i = a; i <=b;i++)
#define dFOR(i,N) for(int i = N - 1; i>=0;i--)
#define edFOR(i,a,b) for(int i = b ; i >=a;i--)
#define all(x) x.begin(),x.end()
#define SORT(x) sort(all(x))
#define RSORT(x) sort(x.rbegin(),x.rend())
#define mine(x) min_element(all(x))
#define maxe(x) max_element(all(x))
#define pb push_back
#define PI 3.14159265359
const int mod = 1e9 + 7;
int CASE = 1;
bool prime(ll n)
{
	if (n <= 1)
		return false;
	for (int i = 2; i <= sqrt(n); i++)
		if (!(n % i))
			return false;
	return true;
}
void solve()
{
	ll n;
	cin >> n;
	if (n == 1)
	{
		cout << 1;
		return;
	}
	if (prime(n))
	{
		cout << 1 << endl << n;
		return;
	}
	vll ans = { 1 , n };
	bool check = false;
	if (int(sqrt(n)) * sqrt(n) == n)
		ans.pb(sqrt(n)), check = true;;
	eFOR(i, 2, sqrt(n - check))
	{
		if (n % i == 0)
			ans.pb(i), ans.pb(n / i);
	}
	SORT(ans);
	FOR(i, ans.size())
		cout << ans[i] << endl;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int T = 1;
	while (T--)
	{
		solve();
	}
}