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 <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
    int number_of_datasets;
    cin >> number_of_datasets;

    char A[81];
    char B[81];
    while (number_of_datasets-- > 0) {
        fill_n(A, 81, '\0');
        fill_n(B, 81, '\0');
        string input;
        cin >> input;
        if (input.length() > 80) {
            cin >> input;
            cout << "overflow" << endl;
            continue;
        }
        copy(input.rbegin(), input.rend(), A);
        cin >> input;
        if (input.length() > 80) {
            cout << "overflow" << endl;
            continue;
        }
        copy(input.rbegin(), input.rend(), B);

        for (char & n : A) {
            if (n == '\0') {
                break;
            }

            n -= '0';
        }

        for (char & n : B) {
            if (n == '\0') {
                break;
            }

            n -= '0';
        }

        char carry = 0;
        for (int i = 0; i < 81; i++) {
            A[i] += B[i] + carry;
            if (A[i] >= 10) {
                A[i] -= 10;
                carry = 1;
            } else {
                carry = 0;
            }
        }
        
        if (A[80] != 0) {
            cout << "overflow";
        } else {
            int last_valid_place = 0;
            for (int i = 80; i >= 0; i--) {
                if (A[i] != 0) {
                    last_valid_place = i;
                    break;
                }
            }

            for (int i = last_valid_place; i >= 0; i--) {
                A[i] += '0';
                cout << A[i];
            }
        }

        cout << endl;
    }
}

C++: // AOJ 0015
#include<algorithm>
#include<iostream>
#include<string>
#define rep(i,a) for( int i = 0; i != (a); ++i )

int N;
std::string a, b;

int main()
{
	std::cin >> N;
	while( N-- )
	{
		std::cin >> a >> b;
		int asz = a.size(), bsz = b.size(), sz = std::max( asz, bsz );
		if( asz > 80 || bsz > 80 )
		{
			std::cout << "overflow" << std::endl;
			continue;
		}

		std::reverse( a.begin(), a.end() );
		std::reverse( b.begin(), b.end() );

		
		a.resize( 80 );
		b.resize( 80 );

		std::string ans;
		int c = 0;
		rep( i, sz )
		{
			if( i >= asz )
				a[i] = '0';
			if( i >= bsz )
				b[i] = '0';

			int t = int(a[i])+b[i]+c-2*'0';
			c = 0;
			
			if( t >= 10 )
				c = 1, t %= 10;
			ans += char(t+'0');
		}

		if( c )
			ans += '1';

		if( ans.size() > 80 )
			std::cout << "overflow" << std::endl;
		else
		{
			rep( i, ans.size() )
				std::cout << ans[ans.size()-1-i];
			std::cout << std::endl;
		}
	}

	return 0;
}

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

int main(){
	int n;
	cin >> n;
	while( n-- > 0 ){
		string num1, num2;
		cin >> num1 >> num2;
		char sum[101];
		int degit = 0;
		for( int i = 0; i < sizeof(sum); i++ ) sum[i] = '0';
		for( int i = 0; i < num1.size(); i++ ){
			sum[100-i] = num1[num1.size()-i-1];
		}
		int d;
		for( int i = 0; i < num1.size() || i < num2.size() || degit != 0; i++ ){
			int now;
			if( i < num2.size() ){
				now = (int)(sum[100-i]-'0') + (int)(num2[num2.size()-i-1]-'0') + degit;
			}else{
				now = (int)(sum[100-i]-'0') + degit;
			}
			sum[100-i] = (char)(now%10+'0');
			if( now >= 10 ) degit = 1;
			else degit = 0;
			d = i;
		}
		for( int i = 100-d; i < 101; i++ ) cout << sum[i];
		cout << endl;
	}
}

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 && res.size()-j > 79){
        cout << "overflow" << endl;
        return 0;
      }
      if(f) cout << res[j];
    }

    cout << endl;
  }

  return 0;
}

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

int n;
string s, t, ans;

string p(const string &s, const string &t) {
	string res;
	int l1 = s.length()-1, l2 = t.length()-1;
	int L = max(l1, l2);
	int pre = 0;
	for (int i = 0; i <= L; ++i) {
		int sum = pre;
		sum += (l1>=0 ? s[l1--]-'0' : 0);
		sum += (l2>=0 ? t[l2--]-'0' : 0);
		pre = sum/10;	// 繰り上げ分
		sum -= pre*10;
		res += '0' + sum;
	}
	if (pre) res += '0' + pre;
	reverse(res.begin(), res.end());
	return res;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	
	cin >> n;
	rep(T,n) {
		cin >> s >> t;
		ans = p(s, t);
		if (ans.length() > 80) cout << "overflow" << endl;
		else cout << ans << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
#define ALL(v) v.begin(),v.end()
string calc(string a,string b){
  reverse(ALL(a));
  reverse(ALL(b));
  while(a.size() < b.size())a += '0';
  while(b.size() < a.size())b += '0';
  int c=0;
  string res;
  for(int i=0;i<a.size();i++){
    c = c+a[i]-'0'+b[i]-'0';
    res += c%10+'0';
    c /= 10;
  }
  if(c)res += c+'0';
  if(res.size() > 80)return "overflow";
  reverse(ALL(res));
  return res;
}
int main(){
  int n;
  string a,b;
  cin>>n;
  while(n--){
    cin>>a>>b;
    cout<<calc(a,b)<<endl;
  }
  return 0;
}