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 <algorithm>
#include <string>
#include <sstream>

using namespace std;

inline int toInt(string s) { int v; istringstream sin(s); sin>>v; return v; }
template<class T> inline string toString(T x){ ostringstream sout; sout<<x; return sout.str(); }

#define dump(x) cerr<<#x<<" = "<<(x)<<endl;
#define debug(x) cerr<<#x<<" = "<<(x)<<"(L"<<__LINE__<<")"<<" "<<__FILE__<<endl;

int main(){
	int N; cin >> N;
	for (int i = 0; i < N; i++) {
		string a, b; cin >> a >> b;
		if (a.size() < b.size()) {
			string tmp("");
			for (int j = 0; j < b.size()-a.size(); j++) { tmp += "0"; }
			a = tmp + a;
		} else if (b.size() < a.size()) {
			string tmp;
			for (int j = 0; j < a.size()-b.size(); j++) { tmp += "0"; }
			b = tmp + b;
		}
		
		string res("");
		for (int j = 0; j < a.size()+1; j++) res += "0";
		a = "0"+a; b = "0"+b;
		for (int j = res.size()-1; j >= 0; j--) {
			int cur = 0;
			if (res[j] >= '0' && res[j] <= '9') {
				cur = res[j]-'0';
			}
			int ai = a[j]-'0', bi = b[j]-'0';
			int res_tmp = ai+bi+cur;
			if (res_tmp >= 10) { 
				res[j] = '0'+(res_tmp%10);
				res[j-1] = '0'+(res_tmp/10); 
			} else {
				res[j] = '0'+res_tmp;
			}
		}
		int j = 0;
		while (res[j] == '0') { j++; }
		string ans("");
		for (; j < res.size(); j++) ans += res[j];
		
		if (ans.size() > 80) {
			cout << "overflow" << endl;
		} else {
			cout << ans << endl;
		}
	}

	return 0;
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n;
	cin >> n;
	
	while(n-- > 0){
	
	string str1;
	cin >> str1;
	
	string str2;
	cin >> str2;
	
	reverse(str1.begin(), str1.end());
	reverse(str2.begin(), str2.end());
	
	int check;
	if(str1.size() > str2.size()){
		check = 1;
	}
	else if(str1.size() == str2.size()){
		check = 2;
	}
	else {
		check = 3;
	}
	
	int ans[100];
	bool next = false;
	int short_ = min(str1.size(), str2.size());
	int long_ = max(str1.size(), str2.size());	
	if(long_ >= 80){
		cout << "overflow" << endl;
		continue;
	}

	for(int i = 0; i < short_; ++i){
		int num = 0;
		num += (str1[i] - '0') + (str2[i] - '0');
		if(next){
			num++;
		}
		ans[i] = num;
		next = false;	
		if(num >= 10){
			num -= 10;
			ans[i] -= 10;
			next = true;
		}
		//cout << num << endl;
	}
	/*for(int i = 0; i < min(str1.size(), str2.size()); ++i){
		cout << ans[i];
	}
	cout << endl;*/
	
	if(check == 1){
		for(size_t i = str2.size(); i < str1.size(); ++i){
			int num = str1[i] - '0';
			if(next){
				num++;
			}
			ans[i] = num;
			next = false;	
			if(num >= 10){
				num -= 10;
				ans[i] -= 10;
				next = true;
			}
		}
		if(next){
			ans[str1.size()] = 1;
			long_ ++;
		}
	}	
	
	if(check == 3){
		for(size_t i = str1.size(); i < str2.size(); ++i){
			int num = str2[i] - '0';
			if(next){
				num++;
			}
			ans[i] = num;
			next = false;	
			if(num >= 10){
				num -= 10;
				ans[i] -= 10;
				next = true;
			}
		}
		if(next){
			ans[str2.size()] = 1;
			long_ ++;
		}
	}
	
	if(long_ >= 80){
		cout << "overflow" << endl;
		continue;
	}

	for(int i = long_ - 1; i >= 0; --i){
		cout << ans[i];
	}/*
	for(int i = 0; i < min(str1.size(), str2.size()) + 1; ++i){
		cout << ans[i];
	}*/

	cout << endl;
	//reverse(ans.begin(), ans.end());
	//cout << ans << endl;
	}
		
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>

using namespace std;

// ツ閉カツ篠堋療アツづ個青板篠堋づ個堕ォツつオツ算ツづーツ行ツつ、
string add (string a, string b)
{
	reverse (a.begin(), a.end() );
	reverse (b.begin(), b.end() );

	while (a.length() != b.length()){
		if (a.length() > b.length()){
			b += '0';
		}else if (a.length() < b.length() ){
			a += '0';
		} // end if
	} // end while
	
	int i;
	string res = "";
	int carry = 0;
	
	for (i = 0; i < a.length(); ++i){
	
		int an = a[i] - '0';
		int bn = b[i] - '0';
		int sum = an + bn + carry;
	
		res += sum % 10 + '0';
		carry = sum/10;

	} // end for
	
	if (carry == 1){
		res += carry + '0';
	} // end if

	reverse (res.begin(), res.end() );
	
	return res;
}

int main()
{
	string str = "";
	int n;

	getline (cin, str );
	stringstream ssn(str);
	ssn >> n;

	int i;
	for (i = 0; i < n; ++i){
		string a,b;
		string res = "";

		getline (cin, a);
		getline (cin, b);

		res = add (a, b);

		if (res.length() > 80){
			cout << "overflow" << endl;
		}else{
			cout << res << endl;
		} // end if		
	} // end for

	return 0;
}

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

int main()
{
  int n;
  cin >> n;
  getchar();
  while( n --){
    int i;
    int A[500] = {} , B[500] = {};
    stack<int> C;
    char a, b;
    int end;
    i = 100;
    while(1) {
      a = getchar();
      if(a == '\n') break;
      A[i] = a - '0';
      i--;
      if(i < 20) break;

    }
    int j = 100;
    while(1) {
      b = getchar();
      if(b == '\n') break;
      B[j] = b - '0';
      j--;
      if(j < 20)  break; 

    }
    if( i < 20  || j < 20 ) {  cout << "overflow" <<endl; continue; }

    if(i > j)
      end = 101 - j;
    else
      end = 101 - i;

    A[i++] += B[j++];
  
    for(int k = 0; k <= end ; i++, j++, k++) {
      A[i] += B[j];
      A[i] += A[i - 1] / 10;
      A[i - 1] %= 10;
      C.push(A[i - 1]);
    }
    if(C.top() == 0 && C.size() != 1) {
      C.pop();
    }
    end = C.size() - 1;
    if(end > 80){
      cout << "overflow" << endl;
      continue;
    }

    for(i = 0; i < end; i++) {
      cout << C.top();
      C.pop();
    }
  
    cout << endl;
  
  }
}

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

int main(){
	string a, b;
	vector<int> ans;
	int n, num, ai, bi, c=0;
	bool flag;

	cin >> n;
	
	for(int i=0 ; i<n ; i++){
		cin >> a >> b;
		flag = false;
		
		for(int j=0 ; j<100 ; j++){
			num = 0;
			ai = a.size()-j-1;
			bi = b.size()-j-1;
			if( ai<0 && bi<0 && c==0) break;
			
			if(ai>=0)num += a[ ai ] - 48;
			if(bi>=0)num += b[ bi ] - 48;
			ans.push_back( (num+c)%10 );
			if(num+c >= 10) c = 1;
			else c = 0;
		}
		if(ans.size()>80){
			flag = true;
		}
		if(flag){
			printf("overflow");
		}else{
			for(int j=ans.size()-1 ; j>=0 ; --j){
				printf("%d", ans[j]);
			}
		}
		printf("\n");
		ans.clear();
	}
	return 0;
}

C++: #include "bits/stdc++.h"

#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef long long ll;

void solve() {
#ifdef _WIN32
	istream &cin = ifstream("input.txt");
#endif
	int n;
	cin >> n;
	rep(i, n) {
		vector<int> v1(101), v2(101);
		string s1, s2;
		cin >> s1 >> s2;
		if (s1.size() > 80 || s2.size() > 80) {
			cout << "overflow" << endl;
			return;
		}

		rep(j, s1.size()) v1[j] = s1[s1.size() - j - 1] - '0';
		rep(j, s2.size()) v2[j] = s2[s2.size() - j - 1] - '0';
		
		rep(j, 100) {
			v1[j] += v2[j];
			if (v1[j] >= 10) {
				v1[j] -= 10;
				v1[j + 1]++;
			}
		}
		int digit = 0;
		for (int j = 100; j >= 0; j--) {
			if (digit == 0 && v1[j]) {
				digit = j;
				break;
			}
		}
		if (digit >= 80) cout << "overflow" << endl;
		else {
			for (int j = digit; j >= 0; j--) cout << v1[j];
			cout << endl;
		}
	}

}




int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	solve();
	//system("PAUSE");
	return 0;
}