Problem11306--[yosupo] Big Integer - Addition of Hex Big Integers

11306: [yosupo] Big Integer - Addition of Hex Big Integers

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 512 MiB

Description

This problem has $T$ cases.  
Given hexadecimal integers $A$ and $B$, print hexadecimal integer $A+B$. 

Input

$T$
$A$ $B$
 $\vdots$
$A$ $B$

Output

$A+B$
 $\vdots$
$A+B$

Constraints

- $1 \leq T \leq 160000$
- $0 \leq |A|, |B| < 16^{16\times10^5}$
- The sum of (the number of characters in $A$) $+$ (the number of characters in $B$) over all test cases does not exceed $3,200,002$.

Sample 1 Input

9
47 FF
50 FF
3 -FF
0 -FF
-A0 -EFE
1234567890ABCDEF1234567890ABCDEF FEDCBA9876543210FEDCBA9876543210
-1234567890ABCDEF1234567890ABCDEF FEDCBA9876543210FEDCBA9876543210
-1234567890ABCDEF1234567890ABCDEF -FEDCBA9876543210FEDCBA9876543210
1234567890ABCDEF1234567890ABCDEF -1234567890ABCDEF1234567890ABCDEF

Sample 1 Output

146
14F
-FC
-FF
-F9E
111111111070000001111111106FFFFFF
ECA8641FE5A86421ECA8641FE5A86421
-111111111070000001111111106FFFFFF
0

HINT

Yosupo.

Source/Category