Under construction

Still being built. Things may change

Add Backward Numbers

Interview

Time limit1sMemory limit128 MB

Summary
Add two numbers whose digits are given in reverse order, printing the sum with its digits also reversed and no leading zeroes.
Level

Easy3 of 10

Topics
Math, String, Implementation, Simulation
Solved
No attempts yet

Problem

A backward number is written in ordinary Arabic numerals, but with the order of its digits reversed: the first digit becomes the last, and vice versa. For example, the number 12451245 becomes 54215421.

All leading zeroes are omitted. So if a number ends in a zero, that zero is lost by the reversal; for example, 12001200 becomes 2121. Consequently, a backward number never has any trailing zeroes.

Your task is to add two backward numbers and output their sum, again as a backward number. In general the result is not unique (for example, 2121 could have come from 1212, 120120, or 12001200), so we assume that no zeroes were lost in the reversal (that is, we assume the original number was 1212).

Input

The first line contains a single integer NN (N>0N > 0), the number of cases. Each of the following NN lines contains two non-negative integers separated by a space; these are the backward numbers to add. Every number satisfies 0≤n<1090 \le n < 10^9.

Output

For each case, print exactly one line containing a single integer: the backward sum of the two backward numbers. Omit any leading zeroes.

Examples1

  1. Example 1

    Input
    4
    24 1
    101 0
    4358 754
    305 794
    
    Expected output
    34
    101
    1998
    1