Time Limit: 1000 mSec
Memory Limit: 32768 KB
Nancy has bought a lottery. The lottery numbers are positive integers. The prized lottery numbers are determined by randomizing two integers m and k (m>=0, k>=1). Any lottery number that contains m 0's can be prized, and the kth number is the first prize if all the prized numbers are sorted in an ascending order. Nancy won the first prize with a lucky number, for the number of digits and the leftmost digit in the first prized number happen to make up the date of Nancy's birthday. Can you work out Nancy's birthday?
The first line in the input is an integer N representing the number of test cases. The following N lines are N test cases. Each line contains two integers separated by one space , where the first integer is m and the second is k (0<=m<=10，1<=k<=10^12).
For each test case, output a line containing two integers separated by one space, where the first integer is the number of digits in the first prized number and the second integer is the leftmost digit in the first prized number.