//0015 National Budget
//80ÜÅÌ2ÂÌ®Ì«µZÊðoÍ¹æ
//1sÚÉf[^Zbgnª^¦çêé

#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;

int main(void)
{
	int n;
	cin >> n;
	while(n--)
	{
		const int N = 82;
		char a[N], b[N], c[N] = "";
		int i;

		cin >> a >> b;

		//CfbNXª¬³¢Ù¤©çºÌÉÈéæ¤É½ÎÉ·é
		reverse(a, a+strlen(a));
		reverse(b, b+strlen(b));

		bool isReadA = true, isReadB = true;
		for(i = 0; i < N; i++)
		{
			int s = 0;
			if(isReadA)
			{
				int lhv = a[i];
				if(!lhv)
					isReadA = false;
				else
					s += (lhv-'0');
			}
			if(isReadB)
			{
				int rhv = b[i];
				if(!rhv)
					isReadB = false;
				else
					s += (rhv-'0');
			}

			
			c[i] += s;
			if(c[i] >= 10)
			{
				c[i+1]++;
				c[i] -= 10;
			}
			c[i] += '0';

			if(!isReadA && !isReadB)
			{
				if(c[i] == '0')
					c[i] = '\0';
				break;
			}
		}

		reverse(c, c+strlen(c));
		cout << c << endl;
	}
	return 0;
}