Problem A
Candy Division

Benny has just found out that he has $N$ candies in his pocket. He is always happy to share candies with his friends, because then he doesn’t have to eat them alone and get fat. There is one problem, though. He cannot invite any number of friends, since it would be impossible to divide candies evenly among people.

Given $N$, how many people can Benny invite to eat candies, so that everybody gets the same number of candies and all candies will be eaten?


The input contains one line with one integer $N$ ($2\leq N\leq 10^{12}$), denoting the number of candies in Benny’s pocket.


Output one line with all possible number of friends Benny can invite. Output them in ascending order and separate by spaces.

Sample Input 1 Sample Output 1
0 1 2 4 5 9 14 29

Please log in to submit a solution to this problem

Log in