#define PROBLEM "https://judge.yosupo.jp/problem/addition_of_big_integers"
#include"../template.h"
#include"BigInt.h"voidsolve(){intt;cin>>t;while(t--){strings1,s2;cin>>s1>>s2;BigInta(s1),b(s2);cout<<a+b<<'\n';}}
#line 1 "Big_Integer/Addition_of_Big_Integers.test.cpp"
#define PROBLEM "https://judge.yosupo.jp/problem/addition_of_big_integers"
#line 2 "template.h"
#include<bits/stdc++.h>usingnamespacestd;#define ll long long
#define MOD (ll)(1e9+7)
#define all(x) (x).begin(),(x).end()
#define unique(x) x.erase(unique(all(x)), x.end())
#define INF32 ((1ull<<31)-1)
#define INF64 ((1ull<<63)-1)
#define inf (ll)1e18
#define vi vector<int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define fi first
#define se second
constintmod=998244353;voidsolve();intmain(){ios_base::sync_with_stdio(false);cin.tie(NULL);// cin.exceptions(cin.failbit);// int t; cin >> t;// while(t--)solve();cerr<<"\nTime run: "<<1000*clock()/CLOCKS_PER_SEC<<"ms"<<'\n';return0;}#line 2 "Big_Integer/BigInt.h"
classBigInt{public:staticconstintBASE=10;vector<uint32_t>digit;boolneg=false;BigInt(){}BigInt(int64_tval){*this=val;}BigInt(conststring&s){*this=s;}uint32_tgetDigit(constuint32_ti)const{returndigit[i];}uint32_tsize()const{returndigit.size();}boolisZero()const{returndigit.empty();}intcompare(constBigInt&b)const{if(size()!=b.size())returnsize()>b.size()?1:-1;elseif(size()<b.size())return-1;for(inti=(int)size()-1;i>=0;i--){if(digit[i]!=b.getDigit(i))returndigit[i]>b.getDigit(i)?1:-1;}return0;}voidtrim(){while(!digit.empty()&&digit.back()==0)digit.pop_back();if(digit.empty())neg=false;}BigInt&operator=(int64_tval){digit.clear();if(val<0){neg=true;val=-val;}while(val){digit.push_back(val%BASE);val/=BASE;}return*this;}BigInt&operator=(conststring&s){digit.clear();int32_tpos=0;if(s[0]=='-'){neg=true;pos=1;}for(inti=(int)s.size()-1;i>=pos;i--){digit.push_back(s[i]-'0');}trim();return*this;}friendostream&operator<<(ostream&out,constBigInt&b){if(b.isZero())returnout<<"0";if(b.neg)out<<"-";for(inti=(int)b.size()-1;i>=0;i--)out<<b.getDigit(i);returnout;}BigIntoperator+(constBigInt&b)const{BigIntres;if(neg==b.neg){res.neg=neg;intcarry=0;size_tlen=max(size(),b.size());for(size_ti=0;i<len;i++){intsum=carry;if(i<size())sum+=digit[i];if(i<b.size())sum+=b.getDigit(i);res.digit.push_back(sum%BASE);carry=sum/BASE;}if(carry)res.digit.push_back(carry);res.trim();returnres;}else{return*this-(-b);}}BigIntoperator-(constBigInt&b)const{if(!neg&&b.neg)return*this+(-b);if(neg&&!b.neg)return-((-*this)+b);if(compare(b)==-1)return-(b-*this);BigIntres;res.neg=neg;intborrow=0;for(size_ti=0;i<digit.size();i++){intsub=digit[i]-borrow;if(i<b.size())sub-=b.getDigit(i);if(sub<0)sub+=BASE,borrow=1;elseborrow=0;res.digit.push_back(sub);}res.trim();returnres;}BigIntoperator-()const{BigIntres=*this;if(!res.isZero())res.neg=!neg;returnres;}BigIntmul(constBigInt&a,constBigInt&b)const{BigIntx=a,y=b;x.trim();y.trim();BigIntres;if(x.neg!=y.neg)res.neg=true;res.digit.resize(x.size()+y.size());for(size_ti=0;i<x.size();i++){intcarry=0;for(size_tj=0;j<y.size();j++){int64_tcur=res.getDigit(i+j)+carry;cur+=x.digit[i]*y.getDigit(j);res.digit[i+j]=cur%BASE;carry=cur/BASE;}if(carry)res.digit[i+y.size()]+=carry;}res.trim();if(res.isZero())res.neg=false;returnres;}//---------------------karatsuba----------------------BigIntshifted(size_tk)const{if(isZero())return*this;BigIntr=*this;r.digit.insert(r.digit.begin(),k,0);returnr;}BigIntkaratsuba(constBigInt&a,constBigInt&b)const{if(a.size()<32||b.size()<32)returnmul(a,b);size_tn=max(a.size(),b.size());uint32_tk=n/2;BigInta_low,a_high;a_low.digit.assign(a.digit.begin(),a.digit.begin()+min(k,a.size()));a_high.digit.assign(a.digit.begin()+min(k,a.size()),a.digit.end());a_low.neg=a_high.neg=false;a_low.trim();a_high.trim();BigIntb_low,b_high;b_low.digit.assign(b.digit.begin(),b.digit.begin()+min(k,b.size()));b_high.digit.assign(b.digit.begin()+min(k,b.size()),b.digit.end());b_low.neg=b_high.neg=false;b_low.trim();b_high.trim();BigIntz0=karatsuba(a_low,b_low);BigIntz2=karatsuba(a_high,b_high);BigIntz1=karatsuba(a_low+a_high,b_low+b_high)-z0-z2;BigIntres=z2.shifted(2*k)+z1.shifted(k)+z0;res.neg=(a.neg!=b.neg);res.trim();returnres;}BigIntoperator*(constBigInt&b)const{returnkaratsuba(*this,b);}};#line 5 "Big_Integer/Addition_of_Big_Integers.test.cpp"
voidsolve(){intt;cin>>t;while(t--){strings1,s2;cin>>s1>>s2;BigInta(s1),b(s2);cout<<a+b<<'\n';}}