#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main()
{
	int n;
	cin >> n;

	for(int i=0;i<n;++i){
		string N1,N2;
		vector<int> num_line;
		cin >> N1 >> N2;

		int upper=0;
		int num;
		string longer  = N1.size() > N2.size() ? N1 : N2;
		string shorter = N1.size() < N2.size() ? N1 : N2;

		for(int i=0;i<longer.size();++i){
			if(i < shorter.size())
				num = longer[i]-'0' + shorter[i]-'0' + upper;
			else
				num = longer[i] - '0' + upper;
			
			if(num > 9){
				upper = 1;
				if(i != longer.size() -1)
					num -= 10;
			}else{
				upper = 0;
			}

			num_line.push_back(num);
		}

		for(int i = num_line.size()-1;i>=0;--i){
			cout << num_line[i] ;
		}

	}
	return 0;
}