Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	dataset, _ := strconv.Atoi(sc.Text())
	var firstdata *big.Int

	for i := 0; i < dataset*2; i++ {
		n := new(big.Int)
		sc.Scan()
		data, _ := n.SetString(sc.Text(), 10)

		if i%2 == 0 {
			firstdata = data
			continue
		}

		result := new(big.Int)
		if result := result.Add(data, firstdata); len(result.String()) > 80 {
			fmt.Println("overflow")
			continue
		} else {
			fmt.Println(result)
		}
	}
}

C++: #include<algorithm>
#include<iostream>
#include<stdio.h>
#include<string.h>

char a[256], b[256], c[256];	
int sz = 0;
int carry = 0;

int main()
{

	memset( a, '0', 80 );
	memset( b, '0', 80 );
	std::cin >> a >> b;
	
	int maxlen = std::max( strlen( a ), strlen( b ) );
	
	if( maxlen > 80 ){
	 	goto OVERFLOW;
	}
	
	std::reverse( a, a + strlen( a ) );
	std::reverse( b, b + strlen( b ) );
	
	a[strlen( a )] = '0';
	b[strlen( b )] = '0';
	
	for( int i = 0; i <= maxlen + 1; i++ ){
		int na = a[i] - '0' + carry;
		int nb = b[i] - '0';
		
		if( na + nb >= 10 ){
			na += nb - 10;
			carry = 1;
		}
		else{
			na += nb;
			carry = 0;
		}
		
		c[i] = na + '0';
	}
	
	sz = maxlen;
	
	if( c[sz] >= '1' && c[sz] <= '9' ){
	 	sz++;
	}
	
	if( sz >= 80 ){
OVERFLOW:
	 	std::cout << "overflow" << std::endl;
	}
	else{
		std::reverse( c, c + sz );
		c[sz] = '\0';
		std::cout << c << std::endl;
	}

 	return 0;
}

C++: #include<iostream>
#include<cstring>
#include<cstdlib>
using namespace std;

int main()
{
    int N,j;
    cin >> N;
    for(int i=0 ; i<N ; i++){
        int ans[81]={0};
        ans[0]=11111;
        char strA[100],strB[100];
        cin >> strA >> strB;
        if(strlen(strA)>80||strlen(strB)>80){
            cout << "overflow" << endl;
            continue;
        }
        char str1[strlen(strA)][2],str2[strlen(strB)][2];
        for(int i=0 ; i<strlen(strA) ; i++){
            str1[i][0]=strA[i];
            str1[i][1]='\0';
        }
        for(int i=0 ; i<strlen(strB) ; i++){
            str2[i][0]=strB[i];
            str2[i][1]='\0';
        }
        int a[81]={0},b[81]={0};
        a[0]=11111;
        b[0]=11111;
        j=strlen(strA)-1;
        for(int i=80 ; j>=0 ; i--){
            a[i]=atoi(str1[j]);
            j--;
        }
        j=strlen(strB)-1;
        for(int i=80 ; j>=0 ; i--){
            b[i]=atoi(str2[j]);
            j--;
        }
        for(int i=80 ; i!=0 ; i--){
            ans[i]=ans[i]+a[i]+b[i];
            if(ans[i]>=10){
                ans[i]=ans[i]-10;
                ans[i-1]++;
            }
        }
        if(ans[0]!=11111){
            cout << "overflow" << endl;
            continue;
        }
        for(int i=1 ; i<81 ; i++){
            if(ans[i]!=0){
                j=i;
                break;
            }
        }
        for(int i=j ; i<81 ; i++){
         cout << ans[i];
        }
        cout << '\n';
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <math.h>
using namespace std;

int main()
{
	int n;
	cin >> n;
	
	for(int i = 0; i < n; ++i)
	{
		string numA;
		string numB;
		cin >> numA >> numB;
		
		while(numA.size() != numB.size())
		{
			if(numA.size() < numB.size())
			{
				numA = "0" + numA;
			}
			else
			{
				numB = "0" + numB;
			}
		}
		
		numA = "0" + numA;
		numB = "0" + numB;
		
		for(int i = numA.size() - 1; i >= 0; --i)
		{
			int sum = 0;
			sum = (numA[i] - '0') + (numB[i] - '0');
			
			if(sum >= 10)
			{
				sum -= 10;
				numA[i - 1] += 1;
			}
			
			numA[i] = sum + '0';
		}
		
		if(numA.size() > 80)
		{
			cout << "overflow" << endl;
			break;
		}
		if(numA.size() == 80 && numA[0] != '0')
		{
			cout << "overflow" << endl;
			break;
		}
		
		for(int i = 0; i < numA.size(); ++i)
		{
			if(i == 0 && numA[i] == '0') continue;
			cout << numA[i];
		}
		
		cout << endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n;
	string a,b;
	cin >> n;
	while(n--) {
		cin >> a >> b;
		string ret = "";
		reverse(a.begin(),a.end()),reverse(b.begin(),b.end());
		int a_len = a.size(),b_len = b.size();
		int num = max(a_len,b_len),c = 0;
		for(int i = 0; i < num; i++) {
			if(a_len <= i || b_len <= i) c += (b_len <= i ? a[i] : b[i]) - '0';
			else c += a[i] + b[i] - '0' * 2;
			ret += c % 10 + '0';
			c /= 10;
		}
		if(c) ret += c + '0';
		reverse(ret.begin(),ret.end());
		cout << (ret.size() > 80 ? "overflow" : ret) << endl;
	}
	return 0;
}

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

int main()
{
	int N;
	cin>>N;
	while(N--)
	{
		string s1,s2;
		cin>>s1>>s2;
		reverse(s1.begin(),s1.end());
		reverse(s2.begin(),s2.end());
		int r = 0;
		string res = "";
		for(int c=0;c<max(s1.size(),s2.size());c++)
		{
			int s = r;
			r = 0;
			if(c < s1.size()) s += s1[c] -'0';
			if(c < s2.size()) s+= s2[c] - '0';

			r = s/10;
			s%=10;
			res = string(1,s+'0')+res;

		}
		if(r)
		{
			res = string(1,r+'0')+res;
		}
		cout<<(res.size() <= 80?res:"overflow")<<endl;
	}
}

C++: /*
C++ ???????????????????????????????????¬??????
??????AOJ-ITP1??????????????????
*/
#define _USE_MATH_DEFINES

#include <iostream> // ?¨??????\??????
#include <fstream>  // ??????????????\??????
#include <string>   // ???????????¢???
#include <vector>   // ???????????????
#include <cmath>    // ??°??????
#include <iomanip>  // stream???????????¢???
#include <algorithm>// max??¢??°??????

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;        // ????´???°????????????????????????
using std::fixed;         // ???????????????????¨???????????????????????????????
using std::setprecision;  // ?????°????°???°?????\???????????°????????????????????¨????????\???
using std::stoi;

// ?¨??????¨?????¢??°
string calc(string str1, string str2) {
	string res;
	// ???????????????
	reverse(str1.begin(), str1.end());
	reverse(str2.begin(), str2.end());
	
	// ?????°???????????????
	while (str1.size() < str2.size())
	{
		str1 += '0';
	}
	while (str2.size() < str1.size())
	{
		str2 += '0';
	}
	int c = 0;
	// 1????????¨????¨?????????????
	for (size_t i = 0; i < str1.size(); i++)
	{
		c = c + (str1[i] - '0') + (str2[i] - '0');
		res += c % 10+'0';
		c = c / 10;
	}

	// ?????°?????????
	if (c != 0)res += c + '0';
	if (res.size() > 80) return "overflow";
	reverse(res.begin(), res.end());
	return res;
	
}


int main() {
	int num;
	string a;
	string b;
	vector<int> aa, bb;
	cin >> num;
	for (size_t i = 0; i < num; i++)
	{
		cin >> a >> b;
		cout << calc(a, b) << endl;
	}

	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, n;
  int len1, len2;
  char tmp;

  scanf("%d",&n);
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(100, 0), b(100, 0);
    len1 = (int)str1.size(); len2 = (int)str2.size();
    rep(j,len1) a[j] = str1[(int)len1-1-j] - '0';
    rep(j,len2) b[j] = str2[(int)len2-1-j] - '0';

    rep(j,81){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += (sum + '0');
    }

    reverse(res.begin(), res.end());
    int f = 0;
    rep(j,res.size()){
      if(res[j] != '0') f = 1;
      if(f) cout << res[j];
    }

    cout << endl;
  }

  return 0;
}