Large Factorials
Submissions: 2546   Accuracy:

26.54%

  Difficulty: Medium   Marks: 4

Atul is frustrated with large digits factorials so he decided to convert the factorials in power of 10  ( 120 ->   1* 10^2 ). He is not good in programming so he is asking for your help to know the first digit of factorial and power of 10.  

For ex.  5 (120 ->   1* 10^2)   first digit = 1

                                               power     = 2

 

Input

  • The first line of the input contains a single integer T denoting the number of test cases.
  • The first line of each test case contains N .

Output

For each test case, output the two integers separated by space.

Constraints

        1 ≤ T ≤ 101

    •    1 ≤ N≤ 1001

Example

Input:

3

2

5

9

Output:

2 0

1 2

3 5

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: CHANDRAKANT
Author: TheRed_Viper


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.