In a distant land, there lives a fox who loves the mountains more than anything. She walks along the paths where blueberries grow, jumps over mountain rivers, and always strives to climb higher to see the world from a new peak.
One day, while climbing a slope, the fox found exactly flowers on a meadow and wanted to weave a beautiful wreath from them. She noticed an interesting pattern: the wreath turns out beautiful only when all the flowers can be divided into groups of exactly , such that the number of flowers that remain is equal to the last digit of the number (i.e., all the flowers in the wreath). More formally:
n \bmod 10 = n \bmod x
Help the fox figure out how many such magical numbers exist and what these numbers are so that her wreath turns out beautiful.
Note that since the fox wants to minimize the remainder of flowers, she will use all the flowers in the wreath as much as possible until fewer than flowers remain.
* a \bmod b = c means that is divided by with a remainder of , you can read more about it here.
The first line contains one integer (10 \leq n \leq 10^{10}), the number of flowers the fox found.
In the first line, output the number , the count of magical numbers, so that the fox's wreath turns out beautiful.
In the second line, output in sorted order different numbers, each of which is magical.
Example 1
Example 2
For the first test:
1217 \bmod 10 = 1217 \bmod 10 = 7
1217 \bmod 10 = 1217 \bmod 11 = 7
1217 \bmod 10 = 1217 \bmod 22 = 7
1217 \bmod 10 = 1217 \bmod 55 = 7
1217 \bmod 10 = 1217 \bmod 110 = 7
1217 \bmod 10 = 1217 \bmod 121 = 7
1217 \bmod 10 = 1217 \bmod 242 = 7
1217 \bmod 10 = 1217 \bmod 605 = 7
1217 \bmod 10 = 1217 \bmod 1210 = 7
Subtask ( points): (x = 2^k, for some )
Subtask ( points): (n \leq 10^{5})
Subtask ( points): (n \bmod 10 = 0)
Subtask ( points): (cnt_x = 1, where cnt_x is the number of magical numbers)
Subtask ( points): No additional constraints