Captain Huang has found an amazing equation.For some integers n, there exists an positive integer m for which 2m(m + 1) =n(n + 1). The integer n is named as “Amazing Number”. Now, Captain Huang will tell you an integer L, please answer the smallest Amazing Number which is no smaller than L.
The first line is an integer T which represents the number of cases (1<=T<1000).
The following T lines, each line contains an integer L (1<=L<10^190).
For each given L, output the smallest Amazing Number n. If available n does not exist, output -1.
3 1 4 21
3 20 119