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++: /* Karen {{{
  ___  ____
 |_  ||_  _|
   | |_/ /    ,--.   _ .--.  .---.  _ .--.
   |  __'.   `'_\ : [ `/'`\]/ /__\\[ `.-. |
  _| |  \ \_ // | |, | |    | \__., | | | |
 |____||____|\'-;__/[___]    '.__.'[___||__]
}}} */
// include {{{
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <cstdio>
#include <vector>
#include <complex>
#include <iostream>
#include <algorithm>

using namespace std;

// }}}
/* cpp template {{{*/


#define endl '\n'

#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPS(i, a, n) for (int i = (a); i < (n); i++)
#define RREP(i, n) for (int i = 1; i <= (n); i++)
#define X real()
#define Y imag()
#define EQ(n,m) (abs((n)-(m)) < EPS)

typedef double D;      // ??§?¨?????????????double???long double?????????
typedef long long ll;
typedef long double lb;
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<string, int> psi;

inline bool inside(int y, int x, int H, int W){return (y >= 0 && x >= 0 && y < H && x < W);}
inline int in() {int x; std::cin >> x; return x;}

template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << endl;
}
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}

/* ?????° */
const ll MOD = 1e9 + 7;
const ll INF = 1e9 + 9;
const D EPS  = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};


/* }}} */

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

  int n = in();
  while (n--){
    string a, b, y;
    int cnt;
    cin >> a >> b;

    reverse(a.begin(), a.end());
    reverse(b.begin(), b.end());
    while (a.size() < b.size()) a += '0';
    while (b.size() < a.size()) b += '0';

    cnt = 0;
    REP(i, a.size()){
      cnt = a[i] - '0' + b[i] - '0' + cnt;
      y += (cnt % 10 + '0');
      cnt /= 10;
    }
    if (cnt) y += '1';
    reverse(y.begin(), y.end());
    if (y.size() > 80) y = "overflow";
    cout << y << endl;
  }


  return (0);
}

C++: #include<iostream>
#include<string>
int a1[1000],a2[1000],c[1000];
using namespace std;
int main(){
 string s1,s2;
 int i,n,l1,l2,l,x=0;
 cin>>n;

 while(n--){
   cin>>s1>>s2;
   l1=s1.size();
   l2=s2.size();
   for(i=l1-1;i>-1;i--)
     a1[i]=int(s1[l1-i-1])-int('0');
   for(i=l2-1;i>-1;i--)
     a2[i]=int(s2[l2-i-1])-int('0');
   if(l1>l2)
     l=l1;
   else
     l=l2;
   for(i=0;i<l;i++){
     c[i]=a1[i]+a2[i]+x;
     x=c[i]/10;
     c[i]=c[i]%10;
   }
   c[l]=x;
   if (c[l]==1)
    ++l;
   if (l<=80){
     for(i=l-1;i>-1;i--)
       cout<<c[i];
       cout<<endl;
   }
   else {
     cout<<"overflow"<<endl;
     continue;
   }
 }
 return 0;
}

C++: #include<vector>
#include<iostream>
#include<iomanip>
#include<string>
#include<cstdlib>

typedef std::vector<int> bignum;

const int e9=1000000000;

bignum add(const bignum& a,const bignum& b);
bignum subtract(const bignum& a,const bignum& b);
void output(const bignum& num);
int compare(const bignum& a,const bignum& b);
bignum newnum(const std::string& str);

int main()
{
	bignum a,b,sum;
	std::string str;
	int n;
	std::cin>>n;
	for(int i=0;i<n;i++)
	{
		std::cin>>str;
		a=newnum(str);
		std::cin>>str;
		b=newnum(str);
		sum.clear();
		sum=add(a,b);
		if(compare(sum,newnum("10000000000000000000000000000000000000000000000000000000000000000000000000000000"))>=0)
		{
			std::cout<<"overflow"<<std::endl;
		}
		else
		{
			output(sum);
		}
	}
}

bignum add(const bignum& a,const bignum& b)
{
	bignum sum;
	int carry=0;
	long long temp;
	for(int i=0;i<((a.size()>b.size())?a.size():b.size())||carry==1;i++)
	{
		temp=carry;
		carry=0;
		if(i<a.size())
		{
			temp+=a[i];
		}
		if(i<b.size())
		{
			temp+=b[i];
		}
		sum.push_back(temp%e9);
		if(temp>=e9)
		{
			carry=1;
		}
	}

	return sum;
}

int compare(const bignum& a,const bignum& b)
{
	if(a.size()>b.size()){return 1;}
	else if(a.size()<b.size()){return -1;}
	else
	{
		for(int i=a.size()-1;i>=0;i--)
		{
			if(a[i]>b[i]){return 1;}
			else if(a[i]<b[i]){return -1;}
		}
	}
	return 0;
}

bignum newnum(const std::string& str)
{
	bignum num;
	int len;
	for(int i=str.size();i>=0;i-=9)
	{
		len=9;
		if(i<9)len=i;
		num.push_back(atoi(str.substr(i-len,len).c_str()));
	}
	return num;
}

void output(const bignum& num)
{
	for(int i=num.size()-1;i>=0;i--)
	{
		if(i==num.size()-1)
		{
			std::cout<<num[i];
		}
		else
		{
			std::cout<<std::setfill('0')<<std::setw(9)<<std::right<<num[i];
		}
	}
	std::cout<<std::endl;
}