#include <bits/stdc++.h>
using namespace std;

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };


struct Bigint {
  static const int BASE = 100000000, LEN = 8;
  bool negative;
  vector<int> a;
  Bigint& normalize();
  Bigint(int x = 0);
  Bigint(const string& s);
  Bigint& operator = (const Bigint& x);
  Bigint& operator = (int x);
  Bigint& operator = (const string& s);
  const bool operator < (const Bigint& x) const;
  const bool operator > (const Bigint& x) const;
  const bool operator <= (const Bigint& x) const;
  const bool operator >= (const Bigint& x) const;
  const bool operator != (const Bigint& x) const;
  const bool operator == (const Bigint& x) const;
  Bigint operator -() const;
  Bigint& operator += (const Bigint& x);
  Bigint& operator -= (const Bigint& x);
  Bigint& operator *= (const Bigint& x);
  Bigint& operator /= (const Bigint& x);
  Bigint& operator %= (const Bigint& x);
  const Bigint operator + (const Bigint& x) const;
  const Bigint operator - (const Bigint& x) const;
  const Bigint operator * (const Bigint& x) const;
  const Bigint operator / (const Bigint& x) const;
  const Bigint operator % (const Bigint& x) const;

  friend pair<Bigint,Bigint> divmod(const Bigint& lhs, const Bigint& rhs);
  friend istream& operator >> (ostream& is, Bigint& x);
  friend ostream& operator << (ostream& os, const Bigint& x);
  friend const Bigint abs(Bigint x);
};

Bigint& Bigint::normalize() {
  int i = a.size()-1;
  while (i >= 0 && a[i] == 0) --i;
  a.resize(i+1);
  if (a.size() == 0) negative = false;
  return *this;
}

Bigint::Bigint(int x) : negative(x<0) {
  x = abs(x);
  for (; x > 0; x /= BASE) a.push_back(x % BASE);
}

Bigint::Bigint(const string& s): negative(false) {
  int p = 0;
  if (s[p] == '-') { ++p; negative = true; }
  else if (s[p] == '+') { ++p; }
  for (int i = s.size()-1, v = BASE; i >= p; --i, v*=10) {
    int x = s[i]-'0';
    if (x < 0 || 9 < x) {
      cerr<<"error: parse error:"<<s<<endl;
      exit(1);
    } 
    if (v == BASE) {
      v = 1;
      a.push_back(x);
    } else a.back() += (x)*v;
  }
  normalize();
}

Bigint& Bigint::operator = (const Bigint& x) {
  negative = x.negative;
  a = x.a;
  return *this;
}

Bigint& Bigint::operator = (int x) { return *this = Bigint(x); }
Bigint& Bigint::operator = (const string& s) { return *this = Bigint(s); }
const bool Bigint::operator < (const Bigint& x) const {
  if (negative != x.negative) return negative < x.negative;
  if (a.size() != x.a.size()) return (a.size() < x.a.size())^negative;
  for(int i = a.size()-1; i >= 0; --i)
    if (a[i] != x.a[i]) return (a[i] < x.a[i])^negative;
  return false;
}
const bool Bigint::operator > (const Bigint& x) const { return x<(*this); }
const bool Bigint::operator <= (const Bigint& x) const { return !(x<(*this)); }
const bool Bigint::operator >= (const Bigint& x) const { return !((*this)<x); }
const bool Bigint::operator != (const Bigint& x) const { return (*this)<x || x<(*this); }
const bool Bigint::operator == (const Bigint& x) const { return !((*this)<x || x<(*this)); }
Bigint Bigint::operator -() const {
  Bigint ret(*this);
  if (a.size()) ret.negative = !ret.negative;
  return ret;
}
Bigint& Bigint::operator += (const Bigint& x) {
  if (negative != x.negative) return *this -= -x;
  if (a.size() < x.a.size()) a.resize(x.a.size());
  int tmp = 0;
  for (int i = 0; i < a.size(); ++i) {
    a[i] += (i<x.a.size()?x.a[i]:0) + tmp;
    tmp = a[i] / BASE;
    a[i] %= BASE;
  }
  if (tmp) a.push_back(1);
  return *this;
}
Bigint& Bigint::operator -= (const Bigint& x) {
  if (negative != x.negative) return *this += -x;
  vector<int> b(x.a);
  if ((*this < x) ^ negative) {
    a.swap(b);
    negative = !negative;
  }
  for (int i = 0, tmp = 0; i < a.size(); ++i) {
    a[i] += BASE - (i<b.size()?b[i]:0) + tmp;
    tmp = a[i] / BASE - 1;
    a[i] %= BASE;
  }
  return this->normalize();
}
Bigint& Bigint::operator *= (const Bigint& x) {
  negative ^= x.negative;
  vector<int> c(a.size()*x.a.size()+1);
  for (int i = 0; i < a.size(); ++i) {
    long long tmp = 0;
    for (int j = 0; j < x.a.size(); ++j) {
      long long v = (long long)a[i] * x.a[j] + c[i+j] + tmp;
      tmp = v / BASE;
      c[i+j] = (int)(v % BASE);
    }
    if (tmp) c[i+x.a.size()] += (int)tmp;
  }
  a.swap(c);
  return this->normalize();
}
Bigint& Bigint::operator /= (const Bigint& x) {
  return *this = divmod(*this,x).first;
}
Bigint& Bigint::operator %= (const Bigint& x) {
  return *this = divmod(*this,x).second;
}
const Bigint Bigint::operator + (const Bigint& x) const {
  Bigint res(*this); return res += x;
}
const Bigint Bigint::operator - (const Bigint& x) const {
  Bigint res(*this); return res -= x;
}
const Bigint Bigint::operator * (const Bigint& x) const {
  Bigint res(*this); return res *= x;
}
const Bigint Bigint::operator / (const Bigint& x) const {
  Bigint res(*this); return res /= x;
}
const Bigint Bigint::operator % (const Bigint& x) const {
  Bigint res(*this); return res %= x;
}
pair<Bigint,Bigint> divmod(const Bigint& lhs, const Bigint& rhs) {
  if (!rhs.a.size()) {
    cerr<<"error: division by zero"<<endl;
    exit(1);
  }
  Bigint x(abs(rhs)), q, r;
  for (int i = lhs.a.size()-1; i >= 0; --i) {
    r = r * Bigint::BASE + lhs.a[i];
    int head = 0, tail = Bigint::BASE;
    if (r >= x) {
      while (head + 1 < tail) {
        int mid = (head + tail) / 2;
        if (x * Bigint(mid) > r) tail = mid;
        else head = mid;
      }
      r -= x * head;
    }
    q.a.push_back(head);
  }
  reverse(q.a.begin(), q.a.end());
  bool neg = lhs.negative ^ lhs.negative;
  q.negative = neg; r.negative = neg;
  return make_pair(q.normalize(), r.normalize());
}
istream& operator >> (istream& is, Bigint& x) {
  string tmp; is >> tmp;
  x = Bigint(tmp);
  return is;
}
ostream& operator << (ostream& os, const Bigint& x) {
  if (x.negative) os << '-';
  if (!x.a.size()) os << 0;
  else os << x.a.back();
  for (int i = x.a.size()-2; i >= 0; --i) {
    os.width(Bigint::LEN);
    os.fill('0');
    os << x.a[i];
  }
  return os;
}
const Bigint abs(Bigint x) {
  x.negative = false;
  return x;
}

int main() {

  int n; cin >>n;
  while (n--) {
    Bigint a, b;
    cin >> a >> b;
    cout << (a + b) << endl;
  }

  return 0;
}