1. 
/**
* Angewandte Mathematik, SS11
* Problem: 713 Adding Reversed Numbers
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=654
* @author Brielbeck, Daniel
* @author Weber, Georg
* @version 1.0, 04/12/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.148
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class Main {

public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
String input = reader.readLine();
BigInteger mi = new BigInteger("0");
BigInteger nus = new BigInteger("0");
int k = Integer.valueOf(input);
for (int i=0;i<k;i++) {
input = reader.readLine();
String temp1 = input.split(" ")[0];
temp1=turn(temp1);
String temp2 = input.split(" ")[1];
temp2=turn(temp2);
mi = new BigInteger(temp1);
nus = new BigInteger(temp2);
temp2 = String.valueOf(mi.add(nus));
temp2 = turn(temp2);

while(temp2.startsWith("0"))temp2=temp2.substring(1, temp2.length());

System.out.println(temp2);
}
}

static String turn(String input){
StringBuilder output= new StringBuilder();
for (int k=input.length()-1;k>=0;k--){
output.append(input.charAt(k));
}
return output.toString();
}
}