Parliament

Time limit1sMemory limit128 MB

Summary
Split N delegates into groups of distinct sizes so that the product of the sizes is maximized, and print the sizes in ascending order.
Level

Medium4 of 10

Topics
Math, Greedy, Combinatorics
Solved
No attempts yet

Problem

A newly convened parliament has NN delegates. By the current regulation the delegates must be split into disjoint groups whose sizes are all different, and every day each group sends exactly one of its members to a conciliatory committee. The committee's composition must be different on every day, and the parliament stays in session only as long as this can be done.

Write a program that determines how many delegates each group should contain so that the parliament works for as long as possible.

Input

A single integer NN (5≤N≤10005 \le N \le 1000).

Output

Print the sizes of the groups that let the parliament work for the maximum possible time, on a single line in ascending order and separated by spaces. (This choice of group sizes is uniquely determined.)

Examples3

  1. Example 1

    Input
    7
    
    Expected output
    3 4
    
  2. Example 2

    Input
    5
    
    Expected output
    2 3
    
  3. Example 3

    Input
    6
    
    Expected output
    2 4