///////////////////////Loading Payloads.......////////////////////////////
#include<bits/stdc++.h>
#define f(i,a,b) for(int i = a; i < b; i++)
#define fd(i,a,b) for(int i = a; i > b;i--)
#define ll long long
#define fl(i,a,b) for(ll i = a; i < b; i++)
#define VI vector<int>
#define VP vector<pair<int,int>>
#define VS vector<string>
#define VL vector<long long>
#define VC vector<char>
#define VF vector<float>
#define VD vector<double>
#define VB vector<bool>
#define PB push_back
#define F first
#define S second
#define fa(i,skill) for(auto i : skill)
#define fr(i,skill) for(VI :: reverse_iterator i = skill.rbegin(); i != skill.rend(); i++)
#define PI pair<int,int>
#define mi map<int,int>
#define mci map<char,int>
#define all(x) x.begin(),x.end()
#define MAX 1000000007
#define debug(x) cout<<"This side    ----> "<<#x<<" -> "<<x<<endl
using namespace std;

///////////////////////Engine Check.......////////////////////////////
void edit(VI &skill,int n)
{
    f(i,0,n)
        {
            int x;
            cin >> x;
            skill.PB(x);
        }
}
void editl(VL &skill,ll n)
{
    fl(i,0,n)
        {
            ll x;
            cin >> x;
            skill.PB(x);
        }
}


void achilles(int w) 
{

    string s;cin >> s;
    s += s[0];
    cout << s[1]<<s[2]<<s[3] << "\n";

    
}


///////////////////////3....2....1...Ignition////////////////////////////

int main()
{
    ios :: sync_with_stdio(0);
    cin.tie(0);
    //freopen("out.txt","r",stdin);
    int x = 1;
    /*int t;cin >>t ;
    while(t--)*/
    {achilles(x);x++;}
    return 0;  
}
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
using ll = long long;

int main() {
    ll n;
    cin >> n;

    vector<ll> v;
    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            cout << i << "\n";
            if (i * i != n)v.push_back(n / i);
        }
    }
    reverse(v.begin(), v.end());
    
    for (auto &x:v)cout << x << "\n";
    cout << flush;
    return 0;
}
