#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(c,itr) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, n;

  cin >> n;
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(80, 0);
    rep(j,str1.length()) a[j] = str1[str1.length()-1-j] - '0';

    vector<int> b(80, 0);
    rep(j,str2.length()) b[j] = str2[str2.length()-1-j] - '0';

    rep(j,80){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += sum + '0';
    }

    reverse(res.begin(), res.end());
    bool f = false;
    rep(j,res.length()){
      if(res[j] != '0') f = true;
      if(f) printf("%c", res[j]);
    }
    printf("\n");
  }

  return 0;
}