Pooja wants to buy cupcakes such that the number of cupcakes are divisible by 47 and consists "47" as sub-string, in its decimal representation .
Guess the number of cupcakes upto given N(including N ).
Input Format:
The first line of input consists of an integer T , indicating the number of test cases.
For each test case, there will be an integer N as the description.
Output Format:
For each test case, output an integer indicating number of cupcakes upto given N(including N).
Constraints:
1≤T≤104
1≤N≤264−1
For Test Case 1 : n = 123 , there is only 47 which satisfies the condition.
For Test Case 2 : n = 1234, there are 2 such numbers : 47 , 470