#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
//谢谢博友文章 谢谢编书的老师
int main()
{
int NUM;
cin>>NUM;
for(int i=0;i<NUM;i++)
{
string a,b,c;
cin>>a>>b;
reverse(a.begin(),a.end());
reverse(b.begin(),b.end());
c.reserve(100);
int jw=0;
for(int i=a.size()-1,j=b.size()-1;(i>=0)||(j>=0);i--,j--)
{
if((i>=0)&&(j>=0))
{
c=c+(char)((a[i]-'0'+b[j]-'0'+jw)%10+'0');
jw=(a[i]-'0'+b[j]-'0'+jw)/10;
}else if(i<0)
{
c=c+(char)((b[j]-'0'+jw)%10+'0');
jw=(b[j]-'0'+jw)/10;
}else if(j<0)
{
c=c+(char)((a[i]-'0'+jw)%10+'0');
jw=(a[i]-'0'+jw)/10;
}
}
if(jw!=0)
{
c=c+(char)(jw+'0');
}
int flag=0;
for(int i=0;i<c.size();i++)
{
if((flag==0)&&(c[i]=='0'))
{
}else
{
cout<<c[i];
flag=1;
}
}
cout<<endl;
}
return 0;
}