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 <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cctype>
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <functional>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
const double PI = 3.141592653589793238462643383279502884L;
const int LARGE_INT = 1000000007;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define repfn(i,a,cont,next) \
  for(auto i = (a); [=](){return(cont);}(); i = [=](){return(next);}())
#define repby(i,a,b,s) repfn(i,a,i<b,i+s)
#define repab(i,a,b) repby(i,a,b,1)
#define rep(i,b) repab(i,0,b)
#define pb push_back
#define sz(c) int((c).size())

typedef vector<int> bignum;
const int max_digit = 80;

bignum operator+(const bignum& lhs, const bignum& rhs)
{
  int tmp, carry;
  bignum res(max_digit);
  for (int i = 0; i < max_digit; i++) {
    tmp = lhs[i] + rhs[i] + carry;
    if (tmp > 9) {
      carry = 1;
      res[i] = tmp % 10;
    } else {
      carry = 0;
      res[i] = tmp;
    }
  }
  if (carry)
    throw runtime_error("overflow");
  return res;
}

ostream& operator<<(ostream& os, const bignum& rhs)
{
  bool skip = true;
  rtr(rhs, i) {
    if (*i == 0 && skip)
      continue;

    skip = false;
    os << *i;
  }
  return os;
}

istream& operator>>(istream& is, bignum& rhs)
{
  string s;
  int i = 0;
  is >> s;
  rhs.assign(max_digit, 0);
  for (auto p = s.rbegin(); p != s.rend(); p++, i++) {
    rhs[i] = *p - '0';
  }
  if (sz(rhs) > max_digit + 1)
    throw runtime_error("overflow >>");
  return is;
}

int main(int argc, char **argv)
{
  int n;
  bignum a, b;
  string s;
  ostringstream os(s);

  cin >> n;
  try {
    while (n--) {
        cin >> a >> b;
        os << (a + b) << endl;
    }
    cout << os.str();
  } catch (runtime_error& re) {
    cout << re.what() << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][10000];
	char ans[100000];
	int ie[2];
	//
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	//
	scanf("%d",&m);
	m=1;
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		for(int i=0;i<2;i++){
			for(ie[i]=0;in[i][ie[i]]!='\0';ie[i]++){
				in[i][ie[i]]=in[i][ie[i]]-'0';
			}
		}
		ie[0]--;
		ie[1]--;
		Min=max(ie[0],ie[1]);
		if((Min>79)||(Min>78)&&(in[0][0]+in[1][0]>9)){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;min(ien[0],ien[1])+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]];
				cout<<int(in[NMin][ien[NMin]])<<endl;
				if(in[NMin][ien[NMin]+1]>9){
					in[NMin][ien[NMin]+1]-=10;
					in[NMin][ien[NMin]]  +=1;
				}
				
			}
			max10=0;
			if(in[NMin][ien[NMin]+1]>9){
				in[NMin][ien[NMin]+1]-=10;
				max10=1;
			}
			for(int i=0;i<2;i++){
				for(int j=0;j<ie[i]+1;j++){
					in[i][j]=in[i][j]+'0';
				}
			}
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}

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

string reverse(const string& str) {
	string ret;
	string::const_reverse_iterator it = str.rbegin();
	for (; it != str.rend(); it++) {
		ret.push_back(*it);
	}
	return ret;
}

int main()
{
	int N;
	cin >> N;
	for (int i = 0; i < N; i++) {
		string S1;
		string S2;
		int overflow = 0;
		cin >> S1 >> S2;
		if (S1.size() > 80 || S2.size() > 80) {
			cout << "overflow";
			overflow++;
		}
		S1 = reverse(S1);
		S2 = reverse(S2);
		S1.resize(80, '0');
		S2.resize(80, '0');
		int a = 0;
		for (int i = 0; i < 80; i++) {
			S1[i] += S2[i] - '0';
			if (S1[i] > '9') {
				if (i + 1 > 79) {
					cout << "overflow";
					overflow++;
				}
				S1[i + 1] += 1;
				S1[i] -= 10;
			}
			if (S1[i] != '0')
				a = i;
		}
		S1 = reverse(S1);
		if (overflow == 0)
			for (int i = 79 - a; i < 80; i++) {
				cout << S1[i];
			}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<math.h>
using namespace std;
int main() {
	int N,a,b,c,d,f;
	int e = 0;
	int g = 0;
	string s,t,u;
	cin >> N;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 2; j++) {
			if (j == 0) {
				cin >> s;
			}
			else if (j == 1) {
				cin >> t;
			}
		}
		a = s.size();
		b = t.size();
		if (a < b) {
			c = a;
			g = b - a;
		}
		else if (a > b) {
			c = b;
			g = a - b;
		}
		else if (a == b) {
			c = a;
			g = 0;
		}
		for (int k = c - 1; k >= 0; k--) {
			d = s[k] + t[k];
				u[c - k - 1] = d;
		}
		while (g == b - a) {
			for (int i3 = c; i3 < b; i3++) {
				u[i3] = t[i3];
			}
			break;
		}
		while (g == a - b) {
			for (int i4 = c; i4 < a; i4++) {
				u[i4] = s[i4];
			}
			break;
		}
		f = u.size();
		for (int i5 = 0; i5 < f-1; i5++) {
			if (u[i5] > 10) {
				u[i5+1] += 1;
				u[i5] -= 10;
			}
		}
		while (u[f - 1] > 10) {
			u[f] = 0;
			break;
		}
		f = u.size();
		while (f > 80) {
			cout << "overflow" << endl;
			break;
		}
		while (f <= 80) {
			for (int i2 = 0; i2 < f; i2++) {
				cout<< u[f - 1 - i2];
			}
			break;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <deque>
#include <cctype>
using namespace std;

class BigInt {
    static const int base = 10;
    public:
    deque<int> digits;
    BigInt() {
    }
    BigInt operator +(BigInt x) {
        BigInt c;

        // add
        auto di = digits.begin(), xi = x.digits.begin(), end = digits.end();
        for (; di != end && xi != x.digits.end(); di++, xi++)
            c.digits.push_back(*di + *xi);

        // set rest
        if (di == digits.end()) {
            di = xi;
            end = x.digits.end();
        }


        for (; di != end; di++)
            c.digits.push_back(*di);

        // nomalize
        int carry = 0;
        for (int i = 0; i < c.size(); i++) {
            c.digits[i] += carry;
            carry = c.digits[i] / base;
            c.digits[i] %= base;
        }
        if (carry)
            c.digits.push_back(carry);

        return c;
    }
    int size() {
        return digits.size();
    }
    istream &read(istream &is) {
        digits.clear();
        cin.ignore();

        int s;
        while (s = cin.get(), isdigit(s))
            digits.push_front(s - '0');
        is.putback(s);

        return is;
    }
    ostream &write(ostream &os) {
        for (auto di = digits.rbegin(); di != digits.rend(); di++)
            cout << *di;
        return os;
    }
};

istream &operator>>(istream &is, BigInt &b) { return b.read(is); }
ostream &operator<<(ostream &os, BigInt &b) { return b.write(os); }

int main()
{
    for (int n; cin >> n;)
        for (BigInt a, b, c; n-- && cin >> a >> b;) {
            c = a + b;
            if (c.size() <= 80)
                cout << c << endl;
            else
                cout << "overflow" << endl;
        }

    return 0;
}