#GYM104736F. Forward and Backward

Forward and Backward

本题没有可用的提交语言。

Description

A distant planetary system has a single sun and $N-1$ planets. Each planet is identified by a distinct integer from $2$ to $N$. In planet $b$, numbers are represented using base $b$.

A palindromic number is a number that remains the same when its digits are written both forward and backward. In this context, leading zeroes are not considered when determining if a number is palindromic.

The same number can be palindromic in one planet's base but not in another. For instance, in base $10$, the number $33$ is palindromic. It is also palindromic in base $2$ and base $32$ but not in bases such as $3$ or $33$, since $33_{10}=100001_2=1020_3=11_{32}=10_{33}$.

The inhabitants of this planetary system have a peculiar fondness for palindromic numbers and want to know which planets make the number $N$ a palindromic number when represented in their base. Your task is to help them with this cosmic challenge.

The input consists of a single line that contains an integer $N$ ($2 \le N \le 10^{12}$) indicating the number to be checked for palindromic representation. $N$ is given in base $10$.

Output a single line with an increasing list of integers in the interval $[2, N]$, indicating the planets in which $N$ is a palindromic number when expressed in the base of the planet's identifier. Output these integers in base $10$. If $N$ is not palindromic in any of the planets, output the character "*" (asterisk) instead.

Input

The input consists of a single line that contains an integer $N$ ($2 \le N \le 10^{12}$) indicating the number to be checked for palindromic representation. $N$ is given in base $10$.

Output

Output a single line with an increasing list of integers in the interval $[2, N]$, indicating the planets in which $N$ is a palindromic number when expressed in the base of the planet's identifier. Output these integers in base $10$. If $N$ is not palindromic in any of the planets, output the character "*" (asterisk) instead.

33
3
2
2 10 32
2
*