#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define sz size()

const double EPS = 1e-10;
const int INF = 100000000;

int main(){
    int n;
    cin>>n;
    rep(i,n){
        string a,b;
        cin>>a>>b;
        if(a.sz>b.sz)swap(a,b);
        reverse(all(a));
        reverse(all(b));
        int k=b.sz-a.sz;
        rep(i,k)a+='0';
        
        
        int ans[100]={};
        rep(i,b.sz){
            ans[i]+=a[i]-'0'+b[i]-'0';
            if(ans[i]>=10){
                ans[i]-=10;
                ans[i+1]++;
            }
        }
        if(ans[b.sz])cout<<ans[b.sz];
        for(int i=b.sz-1;i>=0;i--){
            cout<<ans[i];
        }
        cout<<endl;
    }
    return 0;
}