P13523 [CodeChef] hes
NOI
题目描述

Ananya, is a class 12 student and is preparing for IIT-JEE examination to be held later this year out of the 3 subjects asked in IIT JEE , physics, chemistry and mathematics she only likes mathematics and is a virtuoso in mathematics seeing her mathematical skills her school math teachers built an inferiority complex against her and wanted to devise a plan to test her mathematical IQ. They probed her with the following problem.
Given a number in the range 1 to 9 inclusive and an exponent E (0 ≤ E ≤ 10000) she had to evaluate the sum of the digits of the final result. Help Ananya make a calculator that can do such massive calculation so she can answer the questions quickly.

Input
The input to the problem consists of a number T on the first line which is the number of test cases for the problem the T test cases then follow each consisting of 2 numbers on a line the digit and the exponent spaced by a blank character.(T ≤ 20).

Output
The output to each test case will be the final value of the result that is (digit raised to exponent) and the sum of the digits of the final result both spaced by a single blank character. Each output must appear on a separate line with the desired results only then the solution will be accepted.

Example

Input:
3
2 4
3 4
9 3

Output:
16 7
81 9
729 18

输入格式

见题面

输出格式

见题面

样例输入
3 2 4 3 4 9 3
样例输出
16 7 81 9 729 18