zhx's submissions

Time Limit: 2000/1000 MS (Java/Others)

Memory Limit: 65536/65536 K (Java/Others)

Description

As one of the most powerful brushes, zhx submits a lot of code on many oj and most of them got AC.
One day, zhx wants to count how many submissions he made on $n$ ojs. He knows that on the $i^{th}$ oj, he made $a_i$ submissions. And what you should do is to add them up.
To make the problem more complex, zhx gives you $n$ $B-base$ numbers and you should also return a $B-base$ number to him.
What's more, zhx is so naive that he doesn't carry a number while adding. That means, his answer to $5 + 6$ in $10-base$ is $1$. And he also asked you to calculate in his way.

Input

Multiply test cases(less than $1000$). Seek $EOF$ as the end of the file.
For each test, there are two integers $n$ and $B$ separated by a space. ($1 \leq n \leq 100$, $2 \leq B \leq 36$)
Then come n lines. In each line there is a $B-base$ number(may contain leading zeros). The digits are from $0$ to $9$ then from $a$ to $z$(lowercase). The length of a number will not execeed 200.

Output

For each test case, output a single line indicating the answer in $B-base$(no leading zero).

Sample Input

2 3 2 2 1 4 233 3 16 ab bc cd

Sample Output

1 233 14

Hint

hujie

Source

BestCoder Round #33

提交代码