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

int main(){
	string sx, sy, sans;
	int n;
	getline( cin, sx );
	sscanf( sx.c_str(), "%d", &n );
	for( int i=0; i<n; i++ ){
		getline( cin, sx );
		getline( cin, sy );
		int zx=0, zy=0;
		while( zx+1<sx.length() && sx[zx]=='0' )	zx++;
		for( int j=0; j<sx.length()-zx; j++ ){
			sx[j] = sx[zx+j];
		}
		while( zy+1<sy.length() && sy[zy]=='0' )	zy++;
		for( int j=0; j<sy.length()-zy; j++ ){
			sy[j] = sy[zy+j];
		}
		if( (sx.length()-zx)>80 || (sy.length()-zy)>80 ){
			cout << "overflow" << endl;
		}else{
			int lenx = sx.length()-zx;
			int leny = sy.length()-zy;
			string &s = (lenx>leny)?sx:sy;
			string &sa = (lenx>leny)?sy:sx;
			int &len = (lenx>leny)?lenx:leny;
			int &lena = (lenx>leny)?leny:lenx;
			sans.resize( len+1 );
			for( int j=0; j<sans.length(); j++ )
				sans[j] = 0;
			for( int j=0; j<lena; j++ ){
				sans[j] += (sa[lena-1-j]-'0') + (s[len-1-j]-'0');
				if( sans[j] > 9 ){
					sans[j] -= 10;
					sans[j+1]++;
				}
			}
			for( int j=lena; j<len; j++ ){
				sans[j] += s[len-1-j]-'0';
				if( sans[j] > 9 ){
					sans[j] -= 10;
					sans[j+1]++;
				}
			}
		}
		if( sans.length()>80 && sans[sans.length()-1]>0 ){
			cout << "overflow" << endl;
		}else{
			for( int j=(sans[sans.length()-1]==0?sans.length()-2:sans.length()-1); j>=0; j-- ){
				cout << (int)sans[j];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(int i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(int i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007
 

int main(){
	int n;
	cin>>n;
	rep(l,n){
		string s,t;
		cin>>s>>t;
		vi ans(80,0);
		if(s.size()>80||t.size()>80) break;
		for(int i=0; i<s.size(); i++){
			ans[80-s.size()+i]+=s[i]-'0';
		}
		for(int i=0; i<t.size(); i++){
			ans[80-t.size()+i]+=t[i]-'0';
		}
		for(int i=79; i>0; i--){
			if(ans[i]>=10) ans[i]-=10, ans[i-1]+=1;
		}
		if(ans[0]>=10) cout<<"overflow"<<endl;
		else{
			bool f=false;
			rep(i,80){
				if(f||(!f && ans[i])||i==79){
					cout<<ans[i];
					f=true;
				}
			}
			cout<<endl;
		}
	}
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define FOR(i,a,b) for(int i=a;i<=b;++i)
#define LL long long
using namespace std;
static const LL INF = 1LL<<61LL;
typedef pair<int,int> PII;

string a,b;
string ans;
int M;
char t[]={'0','1','2','3','4','5','6','7','8','9'};

void add(int n,int m,int c,string s){
    int k;
    if(n-1<0&&m-1<0){
        if(c!=0)s+=t[c];
        for(int i=s.size()-1;i>=0;--i){
            ans+=s[i];
        }
        return ;
    }
    if(n-1>=0&&m-1>=0)k=a[n-1]-'0'+b[m-1]-'0'+c;
    else if(n-1>=0)k=a[n-1]-'0'+c;
    else if(m-1>=0)k=b[m-1]-'0'+c;
    if(k>=10){
        k-=10;
        c=1;
    }
    add(n-1,m-1,c,s+t[k]);
}

/*bool MOD1(string num){
    bool res=false;
    LL k=num.size();
    LL mod;
    int i=-1;
    LL n=0;
    while(k){
        n=(n*10)+num[i+1]-'0';
        mod=n%M;
        n=mod;
        k--;
        i++;
    }
    if(mod==0)return true;
    return false;
}
bool MOD2(string num){
    bool res=false;
    LL k=num.size();
    LL mod;
    int i=-1;
    LL n=0;
    while(k){
        n=(n*10)+num[i+1]-'0';
        mod=n%5;
        n=mod;
        k--;
        i++;
    }
    if(mod==0)return true;
    return false;
}
bool MOD3(string num){
    bool res=false;
    LL k=num.size();
    LL mod;
    int i=-1;
    LL n=0;
    while(k){
        n=(n*10)+num[i+1]-'0';
        mod=n%7;
        n=mod;
        k--;
        i++;
    }
    if(mod==0)return true;
    return false;
}
bool MOD4(string num){
    bool res=false;
    LL k=num.size();
    LL mod;
    int i=-1;
    LL n=0;
    while(k){
        n=(n*10)+num[i+1]-'0';
        mod=n%11;
        n=mod;
        k--;
        i++;
    }
    if(mod==0)return true;
    return false;
}*/
int main(){
    int n;
    cin>>n;
    rep(i,n){
    cin>>a>>b;
    //cin>>M;
        add(a.size(),b.size(),0,"");
        //if(!MOD1(ans)&&!MOD2(ans)&&!MOD3(ans)&&!MOD4(ans))cout<<ans<<endl;
        //else cout<<"king is angry"<<endl;
        if(ans.size()<=80)cout<<ans<<endl;
        else cout<<"overflow"<<endl;
        ans.clear();
    }
}