408733: GYM103274 K Kids at the Party

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

K. Kids at the Partytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Jaime's birthday will be shortly, and their parents are planning a nice party. They know Jaime loves biscuits, so they will bake some. When they talked to Jaime about their plan, he asked them to tell him how many biscuits there will be in order to decide how many friends he would invite.

First, Jaime's parents found strange their son's petition. They know Jaime has exactly 5 friends, and they assumed he would invite all of them. However, Jaime explained he would love to invite as many friends as possible, but he also wishes all of the children receive the same number of biscuits. When Mother and Father listened to so righteous explanation, they realized there were several other things to consider, such as the amount of cake, the sandwiches, and hundreds of things more.

The family came up with an idea to deal with the situation: They will start by knowing the number of biscuits and, based on that information, they will evaluate how many children –Jaime inclusive– there could be at the party. They will analyze the restrictions that other things state later.

Although Jaime is willing to dispense with many of their friends, he cannot imagine his birthday without his bestie Churro (they are guinea pigs, do not make questions), so, at least, there should be one guest.

Given the number of biscuits Jaime wants in the party, help his parents know the number of children that can be at the party.

Input

The first line of input contains a single integer $$$T$$$ ($$$1 \leq T \leq 100$$$) representing the number of cases. Each of the next $$$T$$$ lines contains a single integer $$$n$$$ $$$(2 < n \leq 10^{500})$$$

Output

For each test case, print in a distinct line the number of children that can be at the party. If there is more than one answer, separate them with a space, and print them in ascending order. In case there is no solution, print -1.

ExampleInput
3
19000000
123123123123123123123123123123123123
37
Output
2 4 5
3
-1

加入题单

上一题 下一题 算法标签: