Despite the crisis, the Tech-Prime company continues to operate successfully. The company director decided to give bonuses to the employees. The next day, a list of the awarded employees was published, but instead of the actual amounts, strange numbers and even letters appeared next to the names to hide the payment amounts. The employees quickly realized that the bonuses were recorded in different numeral systems. However, only the secretary, Tetiana, understood which numeral system was used for each employee, remembering that the director had asked her for information about their ages. She figured out that the director dropped the tens digit of each employee's age, took the units digit, and added . The resulting value was used as the base for representing the bonus amount.
Help Tetiana determine the size of each bonus in the decimal system. It is known that the size of the bonus does not exceed units in the decimal system.
The first line contains the number of awarded employees, (n < 50). Each of the next lines contains the age of an employee (not more than ) and the bonus, recorded in some base (the number has no leading zeros, uses Arabic digits and uppercase English letters).
Print the bonus amount in the decimal system for each employee, each on a separate line.
Example 1