PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000024. Thiết kế hệ thống mệnh giá tối đa (Coins)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Thiết kế hệ thống mệnh giá tối đa (Coins)

Coins

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Berland is introducing new coin denominations. The largest denomination must equal nn, all denominations must be distinct positive integers, and the denomination of each coin must be divisible by the denomination of every cheaper coin. Maximize the number of distinct denominations and print any optimal list in decreasing order.

Input

One line contains the positive integer nn, the largest denomination.

Output

Print the denominations of any maximum-cardinality valid system on one line, in decreasing order separated by spaces. Multiple outputs may be valid.

Subtasks

  • Subtask 1 (20 points): 1≤n≤1001\le n\le 100.
  • Subtask 2 (30 points): 1≤n≤100001\le n\le 10000.
  • Subtask 3 (50 points): 1≤n≤10000001\le n\le 1000000.

Examples

Input

10

Output

10 5 1

Explanation

The denominations 10,5,110,5,1 are strictly decreasing and each larger value is divisible by every smaller one. Since 10=2⋅510=2\cdot5 has two prime factors with multiplicity, no divisibility chain can contain more than three denominations.

Input

4

Output

4 2 1

Explanation

The valid chain is 4→2→14\to2\to1. There can be at most three denominations since 4=224=2^2 has two prime factors with multiplicity.

Input

3

Output

3 1

Explanation

The prime 33 has only divisors 11 and 33, so the two-denomination chain 3,13,1 is optimal.