Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<string, ll> PS;
typedef vector<ll> V;

/*int k = 0, n;
string s, t;
vector<string> ans;

int main(){
	cin >> n;
	REP(j,n){
		cin >> s >> t;
		k = 0;
		if (s.size() >= 80 || t.size() >= 80){
			cout << "overflow" << endl;
			continue;
		}
		reverse(ALL(s));
		reverse(ALL(t));
		int a = max(s.size(), t.size()), b = min(s.size(), t.size());
		if (s.size() > t.size()){
			REP(i, a - b){
				t += "0";
			}
		}
		else{
			REP(i, a - b){
				s += "0";
			}
		}		
		reverse(ALL(s));
		reverse(ALL(t));
		REP(i, s.size()){
			int x = (s[s.size()-1-i] - '0') + (t[s.size()-1-i] - '0');
			string q;
			stringstream ss;
			if (i != s.size() - 1){
				ss << ((x + k) % 10);
			}
			else{
				ss << x + k;
			}
			ss >> q;
			ans.push_back(q);
			if (x + k >= 10){
				k = (x + k) / 10;
			}
			else{
				k = 0;
			}
		}
		if (ans.size() >= 79){
			cout << "overflow" << endl;
			continue;
		}
		//cout << ans.size() << endl;
		reverse(ALL(ans));
		REP(i, ans.size()){
			cout << ans[i];
		}
		cout << endl;
		ans.clear();
	}
}*/

int a[110], b[110], ans[110];
string s, t;
int n;

int main(){
	cin >> n;
	while (n--){
		cin >> s >> t;
		if (s.size() > 80 || t.size() > 80){
			cout << "overflow\n";
			continue;
		}
		REP(i, s.size())a[i] = s[s.size() - 1 - i] - '0';
		REP(i, t.size())b[i] = t[t.size() - 1 - i] - '0';
		ll k = 0;
		REP(i, 101){
			ans[i] = (a[i] + b[i] + k) % 10;
			k = (a[i] + b[i] + k) / 10;
		}
		if (ans[80] != 0){
			cout << "overflow\n";
			continue;
		}
		for (int i = max(s.size(), t.size()); i >= 0; i--){
			if (i == max(s.size(), t.size())){
				if (ans[i] != 0){
					cout << ans[i];
				}
			}
			else{
				cout << ans[i];
			}
		}
		cout << endl;
		REP(i, 101){
			ans[i] = 0;
			a[i] = 0;
			b[i] = 0;
		}
	}
}

C++: #include <iostream>
#include <string>

using namespace std;

int main()
{
    int num;

    cin >> num;
    for (int i = 0; i < num; i++) {
        string s1, s2;

        cin >> s1 >> s2;
        if (s1.size() > 80 || s2.size() > 80)
            cout << "overflow" << endl;
        else {
            int i1 = s1.size();
            int i2 = s2.size();
            string ans;
            int tmp = 0;
            int up = 0;

            for ( ; (i1 > 0) && (i2 > 0); i1--, i2-- ) {
                tmp = (s1[i1 - 1] + s2[i2 - 1]) - 2 * '0' + up;
                up = tmp / 10;
                tmp %= 10;
                ans = char(tmp + '0') + ans;
            }
            
            if (i1 > 0) {
                for ( ; i1 > 0; i1--) {
                    tmp = s1[i1 - 1] - '0' + up;
                    up = tmp / 10;
                    tmp %= 10;
                    ans = char(tmp + '0') + ans;
                }
            }
            else if (i2 > 0) {
                for ( ; i2 > 0; i2--) {
                    tmp = s2[i2 - 1] - '0' + up;
                    up = tmp / 10;
                    tmp %= 10;
                    ans = char(tmp + '0') + ans;
                }
            }

            if (up > 0)
                ans = char(up + '0') + ans;

            if (ans.size() > 80)
                cout << "overflow" << endl;
            else
                cout << ans << endl;
        }
    }

    return 0;
}

C++: #include <array>
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

typedef array<int, 11> BigInt;

string BigInt2String(BigInt bi) {
  reverse(bi.begin(), bi.end());
  char buf[89] = {};
  char *pos = buf;
  for (auto i : bi) {
    sprintf(pos, "%08d", i);
    pos += 8;
  }
  string result(buf);
  return result.substr(result.find_first_not_of('0'));
}
  
BigInt String2BigInt(const string& s) {
  BigInt bi { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };

  string t(s);
  int i = 0;
  while (!t.empty()) {
    size_t offset = t.size() < 8 ? 0 : t.size() - 8;
    bi[i++] = atoi(t.substr(offset).c_str());
    t = t.substr(0, offset);
  }
  return bi;
}

string AddBig(const string& x, const string& y) {
  if (x.size() > 80 || y.size() > 80) { return string("overflow"); }

  BigInt x_bi = String2BigInt(x);
  BigInt y_bi = String2BigInt(y);
  BigInt sum { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
  for (int i = 0; i < x_bi.size(); ++i) {
    sum[i] += x_bi[i] + y_bi[i];
    if (sum[i] > 99999999) {
      sum[i + 1] = 1;
      sum[i] -= 100000000;
    }
  }
  if (sum[10] != 0) { return string("overflow"); }
  return BigInt2String(sum);
}
  
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string x, y;
    cin >> x;
    cin >> y;
    cout << AddBig(x, y) << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstring>
using namespace std;
#define MAX 1000
#define temp 85
int main(){
	int x,A[MAX],B[MAX],al,bl,sum[MAX],pre,now;
	char a[MAX],b[MAX];
	cin>>x;
	while(x-->0){
		for(int i=0;i<MAX;i++){
			A[i]=0;
			B[i]=0;
			sum[i]=0;
		}
		cin>>a;
		cin>>b;
		al=strlen(a);
		bl=strlen(b);
		for(int i=0;i<al;i++)
		A[i]=a[al-1-i]-'0';
		for(int i=0;i<bl;i++)
		B[i]=b[bl-1-i]-'0';
		if(al>bl)
		bl=al;
		pre=0;
		for(int i=0;i<=bl;i++){
			if(A[i]+B[i]+pre>9)
				now=1;
			else now=0;
			sum[i]=(A[i]+B[i]+pre)%10;
			pre=now;
		}
		if(sum[bl]!=0){
		for(int i=bl;i>=0;i--)
		cout<<sum[i];
		}
		else {
		for(int i=bl-1;i>=0;i--)
		cout<<sum[i];
		}
		cout<<endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
signed main(){
int a;
cin>>a;
for(int b=0;b<a;b++){
    int goukei[81]{};
    char c[110]{},d[110]{};
    scanf("%s%s",c,d);
    int e,f;
    e=strlen(c);f=strlen(d);
    if(e>80||f>80)puts("overflow");
   else{ e--;f--;
    for(int g=80;g!=0;g--,e--,f--){
	int s=goukei[g];
	if(e>-1)s+=c[e]-48;
	if(f>-1)s+=d[f]-48;
	goukei[g-1]=s/10;
	goukei[g]=s%10;
	}
	if(goukei[0])puts("overflow");
	else{
	    bool ss=false;
	    for(int m:goukei){
		if(m)ss=true;
		if(ss)printf("%d",m);
		}
		puts("");
	    }}
    }
}