In Berland a money reform is being prepared. New coins are being introduced. After long economic calculations was decided that the most expensive coin should possess the denomination of exactly *n* Berland dollars. Also the following restriction has been introduced for comfort: the denomination of each coin should be divisible by the denomination of any cheaper coin. It is known that among all the possible variants the variant with the largest number of new coins will be chosen. Find this variant. Print in the order of decreasing of the coins' denominations.
The first and only line contains an integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">6</sup>) which represents the denomination of the most expensive coin.
"""
#1 brute force / knapsack?
- get all divisors of n
- for each divisor:
    - get max value of count for each prev divisor dividing it as well
    - store best one as prev and its count plus 1
- walk backwards from n, printing 

(can also likely be solved recursively by solving for cases less than n
that must be divisible by n)
------
#2  get all divisors and solve as a knapsack problem?
- find all divisors from 1 to n
- for each divisor, see what max is if we include it or not

trying to find denomination with most coins
most coins for including c_i = max(most for c_(i-1), most for most recent divsor of c_i + 1)
-------------------
#3 Also can be a graph search:
- build adjacency list: j has directed edge to k if k | j; 100 has directed edge to 50 because 50 | 100.
    - get all divisors from 1 to n of n
    - each time a divisor k of n is found, add edge from n to k, and add edges from k to any previous divisors of n that are also divisors of k
- find longest path in graph from n to 1. Shortest path can be achieved with BFS. Since all edges are equal weight, we could exhaustively explore the graph and keep track of longest graph. 
    - Could leverage caching? do we need to re-explore routes if we already know the longest way to get to 1 from them? 
        - Won't be too helpful, will be very small graph since there are likely fewer than 100 nodes, each of which will have relatively few edges
"""

def solve_case(n):
    """
    Approach #2
    """
    # (i, max coins, prev coin)
    divisors = [(1, 1, None)]
    for i in range(2, n+1):
        if (n % i == 0):
            divisors.append((i, 1, None))
    
    for i, divisor in enumerate(divisors[1:], start=1):
        curr = divisor[0]
        for j, j_max, j_prev in divisors[i-1::-1]:
            if (curr % j  == 0) and (j_max >= divisors[i][1]):
                divisors[i] = (curr, j_max+1, j)      
    
    curr = n
    for i, _, prev in divisors[::-1]:
        if i == curr:
            print(i, end=" ")
            curr = prev

if __name__ == '__main__':
    solve_case(int(input()))
