Hide

Problem B
Dividing Sequence

You are given an integer $N$. Your task is to find the longest sequence of integers $a_1<a_2<\dots < a_ k$, such that $a_ i$ divides $a_{i+1}$ and $1 \le a_ i \le N$ for all $i$.

Input

The input contains one line with integer $N, 1\leq N\leq 1\, 000\, 000$.

Output

The first line of output contains the length of the longest sequence. The second line contains space separated numbers $a_1, \ldots , a_ k$ in increasing order.

Sample Input 1 Sample Output 1
6
3
1 3 6

Please log in to submit a solution to this problem

Log in