Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var n int
        var a, b string
        sc := bufio.NewScanner(os.Stdin)
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                sc.Scan()
                a = sc.Text()
                sc.Scan()
                b = sc.Text()

                if len(a) > len(b) {
                        s := add(a, b)
                        if s[len(a)] > 0 {
                                if len(a) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(a)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                } else {
                        s := add(b, a)
                        if s[len(b)] > 0 {
                                if len(b) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(b)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                }
        }
}

// expects ln > lm
func add(n string, m string) (s [100]int) {
        ln := len(n)
        lm := len(m)
        var sum [100]int

        for i := 0; i < ln; i++ {
                var s, t int
                s = int(n[ln-1-i]) - int('0')

                if lm - 1 - i >= 0 {
                        t = int(m[lm-1-i]) - int('0')
                } else {
                        t = 0
                }

                sum[i+1] = (s + t + sum[i]) / 10
                sum[i] = (s + t + sum[i]) % 10
        }

        return sum
}

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;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
	int N;
	string x, y, temp;
	int i, a[80];
	

	cin >> N;

	for(i = 0;i < 80;i++){
		a[i] = 0;
	}

	while(N != 0){
		bool over = false;
		if(N == 0) break;
		cin >> x >> y;
		N--;
		if(x.size() > 80 || y.size() > 80){
			cout << "overflow" << endl;
			continue;
		}

		if(x == "0" && y == "0"){
			cout << "0" << endl;
			continue;
		}

		if(x.size() < y.size()){
			temp = x;
			x = y;
			y = temp;
		}
		int xi = 0, yi = 0;
		for(i = 0;i < x.size();i++){
			xi = x[x.size() - 1 - i] - '0';
			//cout << "xi = " << xi << endl;
			if(i >= y.size()){
				yi = 0;
			}
			else {
				yi = y[y.size() - 1 - i] - '0';
				//cout << "yi = " << yi << endl;
			}
			a[i] += xi + yi;
			//cout << "xi + yi  = " << a[x.size() - 1 - i] << endl;
			if(a[i] > 9){
				if(i < 79){
					a[i] = a[i] - 10;
					a[i + 1] += 1;
				}
				else if(i >= 79){
					cout << "overflow"	<< endl;
					over = true;
					break;				
				}
			}

			
		}
		 
		if(!over){
			bool start = false;
			for(i = 79;i >= 0;i--){
				if(!start && a[i] > 0){
					start = true;
				}
				if(start){
					cout << a[i];
				}
			}
			cout << endl;
		}
		
		for(i = 0;i < 80;i++){
				a[i] = 0;
		}
		
	}
	return 0;
}

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

string strplus(string x,string y){
  if(x.size()>80||y.size()>80)return "overflow";
  string ans="";
  int xa[80],ya[80],za[80];
  for(int i=0;i<80;i++)xa[i]=ya[i]=za[i]=0;
  for(int i=0;i<(int)x.size();i++)xa[i]=x[x.size()-1-i]-'0';
  for(int i=0;i<(int)y.size();i++)ya[i]=y[y.size()-1-i]-'0';
  for(int i=0;i<80;i++){
    za[i]+=xa[i]+ya[i];
    if(za[i]>=10){
      za[i]-=10;
      if(i==79)return "overflow";
      else za[i+1]++;
    }
  }
  int flg=0;
  for(int i=79;i>=0;i--){
    if(flg==0&&za[i]==0)continue;
    else{
      flg=1;
      ans+=(za[i]+'0');
    }
  }
  if(ans=="")return "0";
  else return ans;
}
int main(){
  int n;
  string a,b;
  cin>>n;
  while(n--){
    cin>>a>>b;
    cout<<strplus(a,b)<<endl;
  }
  return 0;
}