You are given 2 numbers n1 and n2. You are supposed to add them and print the result.
Easy!?
Well, the given numbers are in base b. So you have to add them and print the result in base b. (Refer to examples for more clarification.)
Input:
First line contains an integer t - the no of test cases.
Next t lines contain 3 integers b, n1 and n2 each.
Output:
Print a single integer in every line which is the sum of n1 and n2.
Constraints:
1 ≤ t ≤ 10000
1 < b < 10
1 ≤ n1, n2 (in their decimal form) ≤ 10123
Problem Setter: HARSH GANDA
(1010)2 + (1111)2 = (11001)2
(12)3 + (210)3 = (222)3
(1)8 + (7)8 = (10)8