#include <iostream>
#include <string.h>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
  int n, maxlen;
  char a[100], b[100];

  cin >> n;
  for(int ii = 0 ; ii < n ; ii++){
    string ans = "";
    scanf("%s%s", a, b);
    
    maxlen = max(strlen(a), strlen(b));

    reverse(a, a+strlen(a));
    reverse(b, b+strlen(b));
    
    for(int i = strlen(a) ; i < 100 ; i++){
      a[i] = '0';
    }
    for(int i = strlen(b) ; i < 100 ; i++){
      b[i] = '0';
    }

    int tmp, tmp2 = 0;
    bool flag = 0;

    for(int i = 0 ; i < maxlen ; i++){
      tmp = (a[i] - '0') + (b[i] - '0') + tmp2;
      
      if(i == maxlen - 1){
	//cout << "OK" << endl;
	//tmp = (a[i] - '0') + (b[i] - '0') + tmp2;
	if(tmp >= 10){
	  tmp2 = 1;
	  tmp -= 10;
	  ans += tmp + '0';
	  ans += '1';
	}
	else ans += tmp + '0';
      }

      else if(tmp >= 10){
	tmp2 = 1;
	tmp -= 10;
	ans += tmp + '0';
      }
      else if(tmp <= 9){
	ans += tmp + '0';
	tmp2 = 0;
      }
    }

    reverse(ans.begin(), ans.end());

    cout << ans << endl;
  }
  return 0;
}