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 <cstring>
#include <algorithm>

const int MAX_SIZE = 128;

#define toI(x) (x-'0')

using namespace std;

class Z
{
private:
  int size;
  char d[MAX_SIZE];
public:
  Z(char *s)
  {
    size = strlen(s);
    for(int i=0;i<MAX_SIZE - size;i++)
      d[i] = -1;
    for(int i=0,j=MAX_SIZE - size;j < MAX_SIZE; i++, j++)
      d[j] = s[i];
  }

  void add(Z r)
  {
    int tmp = max(this->size, r.size);
    int updigit = 0;
    for(int i=MAX_SIZE-1;i>=0;i--){
      int a = 0, b = 0;
      if(this->d[i] == -1 && r.d[i] == -1){
	if(!updigit)
	  continue;
	this->d[i] = updigit+'0';
	updigit = 0;
	tmp++;
      }else{
	if(this->d[i] != -1)
	  a = toI(this->d[i]);
	if(r.d[i] != -1)
	  b = toI(r.d[i]);
	int n = a + b + updigit;
	updigit = n / 10;
	this->d[i] = (n % 10)+'0';
      }
    }
    this->size = tmp;
    return;
  }

  void print()
  {
    if(this->size > 80){
      puts("overflow");
      return;
    }
    for(int i=0;i<MAX_SIZE;i++)
      if(d[i] != -1)
	putchar(d[i]);
    puts("");
  }

  int sz()
  {
    return this->size;
  }
};

int main()
{
  int d;
  scanf("%d", &d);
  while(d--){
    char s1[128], s2[128];
    scanf("%s",s1);
    scanf("%s",s2);
    Z z1(s1);
    Z z2(s2);
    if(z1.sz() > 80 || z2.sz() > 80){
      puts("overflow");
      continue;
    }
    z1.add(z2);
    z1.print();
  }
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int a_len,b_len,m_len;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		a_len=in.size();
		b_len=in2.size();
		m_len=max(a_len,b_len);
		
	}
	
	
	return 0;
}

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

string plus(string,string);
void turn(string &);
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;++i){
		string str,sts;
		cin>>str>>sts;
		cout<<plus(str,sts)<<endl;
	}
	return 0;
}

string plus(string str,string sts){
	turn(str);
	turn(sts);
	while(str.size()!=sts.size()){
		if(str.size()<sts.size()){
			str+='0';
		}else{
			sts+='0';
		}
	}
	str+='0';
	sts+='0';
	for(int i=0;i<str.size()-1;++i){
		str[i]+=sts[i]-'0';
		while(str[i]>'9'){
			++str[i+1];
			str[i]-=10;
		}
	}
	if(str.back()=='0'){
		str.pop_back();
	}
	if(str.size()>80){
		return "overflow";
	}
	turn(str);
	return str;
}

void turn(string &str){
	for(int i=0;i<str.size()/2;++i){
		swap(str[i],str[str.size()-i-1]);
	}
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>
#include <cstdlib>
#include <typeinfo>
using namespace std;



int main(){
	int n;
	string x, y;
	int a, b, c;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> x >> y;
		if (x.length() > 80 || y.length() > 80)
		{
			cout << "overflow" << endl;
		}
		else
		{
			a = stoi(x);
			b = stoi(y);
			if (to_string(a + b).length() > 80)
			{
				cout << "overflow" << endl;
			}
			else cout << a + b << 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;
}

C++: #include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(){
  string str1,str2;
  int n;

  cin>>n;
  vector<string> ans;

  while((ans.size()<n)&&cin>>str1>>str2){
    string sumstr;
    reverse(str1.begin(),str1.end());
    reverse(str2.begin(),str2.end());

    unsigned size=min(str1.size(),str2.size());
    unsigned i;
    unsigned carry=0;
    for(i=0;i<size;++i){
      unsigned sum=str1[i]+str2[i]+carry-'0'*2;
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }

    string large=(str1.size()>str2.size())?str1:str2;
    for(;i<large.size();++i){
      unsigned sum=large[i]+carry-'0';
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }

    if(carry) sumstr.push_back(carry+'0');
    reverse(sumstr.begin(),sumstr.end());
    sumstr.push_back('\0');

    if(sumstr.size()<=81)
      cout<<sumstr<<endl;
    else
      cout<<"overflow"<<endl;

  }
}

C++: #include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>

#define reep(i,n,m) for(int i=(n);i<(m);i++)
#define rep(i,n) reep(i,0,n)

using namespace std;

//algorithm
//string
class BigInteger{
private:
public:
	string number;
	
	BigInteger(string number):number(number){}
	
	BigInteger operator+(BigInteger integer){
		reverse(number.begin(), number.end());
		reverse(integer.number.begin(), integer.number.end());
		
		int length = max(	integer.number.length(),
							number.length());
	
		int up=0;
	
		string sum="";
	
		for(int i=0;i<length;i++){
			int num1 = 0;
			if(i<integer.number.length()){
				num1 = integer.number[i]-'0';
			}
			int num2 = 0;
			if(i<number.length()){
				num2 = number[i]-'0';
			}
			int n = num1+num2+up;
			if(n<10){
				up=0;
			}else{
				up=1;
				n-=10;
			}
			sum += (char)('0'+n);
		}
		if(up){
			sum += '1';
		}
		reverse(sum.begin(), sum.end());
		return sum;
	}
};

int main(){
	int N;
	cin >> N;
	while(N--){
		string num1,num2;
		cin >> num1 >> num2;
		BigInteger integer = BigInteger(num1) + BigInteger(num2);
		if(integer.number.length()>80){
			puts("overflow");
		}else{
			cout << integer.number << endl;
		}
	}
}

C++: //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0015&lang=jp
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <array>
#include <numeric>
#include <functional>

#define rep(i,n) for(int i=0;i<n;i++)
#define scanInt(i) scanf("%d", &i)

using namespace std;

int main(){

	int n;
	scanInt(n);
	rep(i,n){
        string str1, str2;
        cin >> str1 >> str2;
        if(str1.size() > 80 || str2.size() > 80){
            printf("overflow\n");
        }
        else{
            unsigned long long a = std::stoull(str1);
            unsigned long long b = std::stoull(str2);
            printf("%llu\n", a+b);
        }
    }

    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	int n;
	cin >>n;
	while(n--){
		string a,b,c;
		cin >>a>>b;
		int x = a.size(),y = b.size(),t = 0,max = (x>y)?x:y;
		for(int i=0; i<max; i++){
			if(i<x && i<y){t = (int)a[x-i-1]+(int)b[y-i-1]-2*'0'+t/10;}
			else if(i<x){t = (int)a[x-i-1]-'0'+t/10;}
			else if(i<y){t = (int)b[y-i-1]-'0'+t/10;}
			c+=(char)(t%10)+'0';
		}
		if(t/10){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;
}