Grahc Plays Gokémon Po
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Description
Grahc is playing a game called "Gokémon Po" and he has caught a lot of "Gokémon". Every type of Pokémon has a unique positive integer as its ID. Grahc found that there exists a special item that can transform one type of Gokémon into another type of a strictly larger ID, with the result only depending on its original ID. In other words, there exists a function , if the original ID of the Gokémon is , the ID of the Gokémon after transformation will be .
After several trials, Grahc found that if he uses the item twice in a row on a Gokémon of ID , it will be transformed into a Gokémon of ID , no matter what is.
Grahc wonders what the ID of the transformed Gokémon is if he only uses it once on a Gokémon of ID . He wants you to write a program to predict it. One thing to notice is that Grahc has so many Gokémon, so he may ask you for more than one ID in one case.
That is, given a monotonic incremental function satisfying . Now find for given .
Format
Input
The first line of each input case contains an integer that represents how many IDs he wants you to predict.
The following lines contain one integer each, representing the ID of the -th Gokémon before transformation.
It is guaranteed that the sum of all does not exceed .
Output
For every ID , print the ID of the -th Gokémon after transformation .
Samples
1
4
7
2
1
2
2
3