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 <vector>
#include<string>
#include<sstream>
#define CAPACITY 9


namespace jisaku{//stoi?????¨?????????????????????????????????????????§??£?¨???????

	int stoi(std::string str){
		int ret;
		std::stringstream ss;
		ss << str;
		ss >> ret;
		return ret;
	}

     std::string to_string(int i){
		 std::string text;
		std::stringstream textline;
		textline<< i;
		textline >> text;
		return text;
	}

}




class OverDigit{

public:

	int num_a[CAPACITY];
	int num_b[CAPACITY];
	OverDigit(std::string str_a, std::string str_b);
	void ChangeDigit(std::string str, int num[]);
	void Add();
};

OverDigit::OverDigit(std::string str_a, std::string str_b){

	ChangeDigit(str_a, num_a);
	ChangeDigit(str_b, num_b);

}

void OverDigit::ChangeDigit(std::string str, int num[]){

	std::vector <int> num_str(CAPACITY, 0);
	int loc = CAPACITY, k = 8;
	int  str_rest,str_Max;

	str_rest = str.length() % CAPACITY;
	str_Max = str.length() / 9;

	for (int j = str.length() - CAPACITY; str_Max > 0; j = j - CAPACITY){
		num_str[k] = jisaku::stoi(str.substr(j, CAPACITY));
		loc = k;
		k--;
		str_Max--;

	}
	//?????????????????????????????????????????\??????

	if (str_rest != 0)num_str[loc - 1] = jisaku::stoi(str.substr(0, str_rest));

	for (int j = 0; j < CAPACITY; j++){
		num[j] = num_str[j];
	}
}
//80????????§????¶???????
void OverDigit::Add(){

	int num_ans[CAPACITY] = {};
	int fat, overflow = 0, count = 0;
	std::string text;


	for (int j = CAPACITY - 1; j >0; j--){
		if (num_a[j] + num_b[j] <= 999999999){
			num_ans[j] = num_a[j] + num_b[j];
		}
		else if (num_a[j] + num_b[j] > 999999999){
			fat = (num_a[j] + num_b[j]) - 1000000000;
			num_ans[j] = fat;
			num_a[j - 1]++;
		}

	}

	if (num_a[0] + num_b[0] > 99999999){
		overflow = 1;
	}
	else{
		num_ans[0] = num_a[0] + num_b[0];


	}

	if (overflow == 1){
		std::cout << "overflow" << std::endl;
	}
	else {
		for (int j = 0; j < CAPACITY; j++){
			if (num_ans[j] != 0){
				count++;
				text+=jisaku::to_string(num_ans[j]);
			}
			else if (num_ans[j] == 0 && count >= 1){
				for (int l = 0; l < 8; l++){
					text+="00000000";
				}

			}

		}std::cout <<text<< std::endl;
	}

};


int main(){


	//vector???????????¨??????80???????¨????
	int N;
	std::string str_a, str_b;

	std::cin >> N;
	std::cin.ignore();

	for (int i = 0; i < N; i++){
		getline(std::cin, str_a);
		getline(std::cin, str_b);
		if (str_a == "0" && str_b == "0"){std::cout << '0' << std::endl;
		}
		else if (str_a.length() >= 81 || str_b.length() >= 81){
		
			std::cout << "overflow" << std::endl;
		}
		else{

			OverDigit OverDigit_a(str_a, str_b);//???????????§??????
			OverDigit_a.Add();
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n;
  cin >>n;
  while(n--){
    string a,b,c;
    cin >>a>>b;
    int s_a=a.size(),s_b=b.size();
    int s_max = max(s_a,s_b),s_min = min(s_a,s_b);
    int x=0, y=0;
    for(int i=0; i<s_max; i++){
      if(i<s_min) x = a[s_a-i-1]+b[s_b-i-1]-'0'*2+y;
      else if(i<s_a) x = a[s_a-i-1]-'0'+y;
      else if(i<s_b) x = b[s_b-i-1]-'0'+y;
      y = x/10;
      c+=(char)('0'+x%10);
    }
    if(y>0) c+='1';
    if(c.size()>80) cout <<"overflow";
    else for(int i=c.size()-1; i>=0; i--) cout <<c[i];
    cout <<endl;
  }
  return 0;
}

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

int main() {
    int num; cin >> num;
    for(int k = 0; k < num; k++) {
        string s1, s2, ret;
        vector<int> v1, v2;
        cin >> s1 >> s2;
        if(s2.length() > s1.length()) swap(s1,s2);

        for(int i=0; i<s1.length(); i++) v1.push_back((int)s1[i] - 48);
        for(int i=0; i<s2.length(); i++) v2.push_back((int)s2[i] - 48);
        reverse(v1.begin(), v1.end());
        reverse(v2.begin(), v2.end());

        int n = 0;
        for(int i=0; i<v2.size(); i++) {
            ret += to_string((v1[i] + v2[i] + n) % 10);
            if(v1[i] + v2[i] + n >= 10) n = 1;
            else n = 0;
        }
        for(int i=v2.size(); i<v1.size(); i++) {
            ret += to_string((v1[i] + n) % 10);
            if(v1[i] + n >= 10) n = 1;
            else n = 0;
        }

        if(v1.size() == v2.size() && v1[v1.size() - 1] + v2[v2.size() - 1] + n >= 10) ret += "1";
        else if(v1[v1.size() - 1] + n == 10) ret += "1";

        reverse(ret.begin(), ret.end());
        if(ret.length() > 80) cout << "overflow" << endl;
        else cout << ret << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define all(a) a.begin(),a.end()
using namespace std;

/*int main(){
	int n;
	cin>>n;
	rep(i,0,n){
		string s1,s2;
		cin>>s1>>s2;

		if(s1.size()<s2.size()) swap(s1,s2);

		for(int j=s1.size()-1,k=s2.size()-1;j>=0;j--,k--){
			if(k>=0) s1[j]+=s2[k]-'0';
			if(s1[j]>'9'){
				s1[j]-=10;
				if(s2)
			}
			ans[j]=a%10;
			ans[j+1]=a/10;
			//cout<<" "<<j<<" "<<ans[j]<<endl;
		}
		if(ans[80]>0){
			cout<<"overflow"<<endl; return 0;
		}
		bool f=0;
		for(int i=80;i>=0;i--){
			if(f==0 && ans[i]>0){
				f=1; cout<<ans[i];
			}else if(f) cout<<ans[i];
		}
		cout<<endl;
	}
}*/

int main(){
    int n;
    cin>>n;
    rep(i,0,n){
        int ans[85]={};
        vector<int> n1(80,0),n2(80,0);
        //rep(j,0,81)cout<<n1[j]<<" "<<n2[j]<<endl;
        string s1,s2; 
        cin>>s1>>s2;
        //cout<<s1<<" "<<s2<<endl;
        int sz1=s1.size(),sz2=s2.size();
 
        //rep(j,0,sz1) n1[j]=s1[sz1-1-j]-'0';
        //rep(j,0,sz2) n2[j]=s2[sz2-1-j]-'0';
 		
 		reverse(all(s1));
 		reverse(all(s2));

        rep(j,0,min((int)s1.size(),79)) n1[j]=s1[j]-'0';
        rep(j,0,min((int)s2.size(),79)) n2[j]=s2[j]-'0';

        reverse(all(n1));
        reverse(all(n2));

        for(int j=79;j>=0;j--){
           // cout<<"  "<<j<<" "<<n1[j]<<" "<<n2[j]<<endl;
            ans[j]+=n1[j]+n2[j];
            if(ans[j]>9){
            	if(j>0) {
            		ans[j-1]=1;
            		ans[j]-=10;
            	}
            }
            //cout<<" "<<j<<" "<<ans[j]<<endl;
        }
        if(ans[0]>9){
            cout<<"overflow"<<endl; break;
        }
        bool f=0;
        for(int j=0;j<80;j++){
            if(f==0 && ans[j]>0){
                f=1; cout<<ans[j];
            }else if(f||j==79) cout<<ans[j];
        }
        cout<<endl;
    }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(){
	
	int n;
	for(cin>>n;n--;){
		string a,b;
		cin>>a>>b;
		if(a.size()<b.size())swap(a,b);
		while(a.size()>b.size())b="0"+b;
		int f=0;
		for(int i=a.size()-1;i>=0;i--){
			a[i]+=(f+b[i]-'0');
			if(a[i]>'9'){
				f=1;
				a[i]-=10;
			}
			else f=0;
		}
		if(f)a="1"+a;
		if(a.size()>80){
			cout<<"overflow"<<endl;
			continue;
		}
		cout<<a<<endl;
		
		
	}
	
	return 0;
}