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

using namespace std;

void solve()
{
	int n;
	cin >> n;
	while(n--)
	{
		string a, b;
		cin >> a >> b;
		string l, s;
		a.size() >= b.size() ? (l = a, s = b) : (l = b, s = a);
		reverse(l.begin(), l.end());
		reverse(s.begin(), s.end());
		string sum;
		
		int sizel = l.size();
		int sizes = s.size();
		int buf = 0;
		for(int i = 0; i < sizes; ++i)
		{
			sum += (l[i] + s[i] - '0' - '0' + buf) % 10 + '0';
			buf = (l[i] + s[i] - 2 * '0' + buf) / 10;
		}
		for(int i = sizes; i < sizel; ++i)
		{
			sum += (l[i] - '0' + buf) % 10 + '0';
			buf = (l[i] - '0' + buf) / 10;
		}
		if(buf > 0)
		{
			sum += buf + '0';
		}
		int size = sum.size();
		if(size > 80)
		{
			cout << "overflow" << endl;
			continue;
		}
		for(int i = size - 1; i >= 0; --i)
		{
			cout << sum[i];
		}
		cout << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>

int main()
{
        char a[81], b[81];
        int c[80], ca, cb, set, up = 0;
        std::cin >> set;

        for(int i = 0; i < set; ++i)
        {
                for(int j = 0; j < 80; ++j)
                        c[j] = 0;
                up = ca = cb = 0;
                std::cin >> a >> b;

                for(int j = 0; j < 81; ++j)
                        if((a[j] - '0' < 0) || (a[j] - '0' > 9))
                        {
                                ca = j - 1;
                                break;
                        }

                for(int j = 0; j < 81; ++j)
                        if((b[j] - '0' < 0) || (b[j] - '0' > 9))
                        {
                                cb = j - 1;
                                break;
                        }

                for(int j = 0; j < 80; ++j)
                {
                        if(ca < j && cb < j)
                        {
                                c[j] = up % 10;
                                up = up / 10;
                        }
                        else if(ca < j)
                        {
                                c[j] = (b[cb - j] - '0' + up) % 10;
                                up = (b[cb - j] - '0' +up) / 10;
                        }
                        else if(cb < j)
                        {
                                c[j] = (a[ca - j] - '0' + up) % 10;
                                up = (a[ca - j] - '0' +up) / 10;
                        }
                        else
                        {
                                c[j] = (a[ca - j] - '0' + b[cb - j] - '0' + up) % 10;
                                up = (a[ca -j] - '0' + b[cb - j] - '0' +up) / 10;
                        }
                }

                if(up > 0)
                {
                        std::cout << "overflow" << std::endl;
                        break;
                }

                int k;
                for(int j = 0; j < 80; ++j)
                        if(c[79 - j])
                        {
                                k = j;
                                break;
                        }

                for(int j = k; j < 80; ++j)
                        std::cout << c[79 - j];
                std::cout << std::endl;
        }
        return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
	int N;
	cin >> N;
	while(N--){
		string a,b;
		cin >> a >> b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		while(a.size()>b.size())b += '0';
		while(a.size()<b.size())a += '0';
		string r;
		int c = 0; 
			for(int i = 0 ; i < a.size() ; i++){
			int d = a[i] + b[i] + c - 2 * '0';
			if( d >= 10 ) c = 1;
			r += d%10 + '0';
		}
		if(c)r += '0' + c;
		reverse(r.begin(),r.end());
		if( a.size() >= 80 or b.size() >= 80 or r.size() >= 80 ) cout << "overflow" << endl;
		else cout << r << endl;
	}
}

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

using namespace std;

int main ( void )
{
	int n;

	while ( cin >> n )
	{
		for (int i = 0; i < n; ++i)
		{
			string s1, s2, out = "";
			cin >> s1 >> s2;

			reverse(s1.begin(), s1.end());
			reverse(s2.begin(), s2.end());

			int a, b, c, len = min(s1.size(), s2.size());

			for (int j = c = 0; j < len; ++j)
			{
				int x = (s1[j] - '0') + (s2[j] - '0') + c;
				c = x / 10;
				out += (x % 10 + '0');
			}

			string s;

			if (len == s1.size())
				s = s2;
			else
				s = s1;
			
			for (int j = len; j < s.size(); ++j)
			{
				int x = (s[j] - '0') + c;
				c = x / 10;
				out += (x % 10 + '0');
			}

			if ( c )
			{
				out += '1';
			}

			reverse(out.begin(), out.end());
	
			if ( out.size() > 80 )
				cout << "overflow" << endl;
			else
				cout << out << endl;
		}
	}

	return 0;
}

C++: #include <cassert>
#include <iostream>
#include <string>
#include <vector>

typedef std::vector<char> TLongInt;
TLongInt Decode(const std::string& Code)
{
    std::vector<char> Value(100, 0);
    for(int i = 0; i < Code.size(); ++i){
        Value[i] = Code[Code.size() -1 -i] - '0';
    }
    return Value;
}
TLongInt Add(const TLongInt& A, const TLongInt& B)
{
    assert(A.size() == B.size());
    TLongInt C(A.size(), 0);
    int kuriagari = 0;
    for(int i = 0; i < A.size(); ++i){
        int V = A[i] + B[i] + kuriagari;
        C[i] = V % 10;
        kuriagari = V / 10;
    }
    return C;
}

void Print(const TLongInt& Value, std::ostream& out)
{
    bool Left = true;
    for(int i = Value.size() - 1; i >= 0; --i){
        if(Value[i] == 0 && Left) continue;
        if(i >= 80){
            out << "overflow" << std::endl;
            return;
        }
        Left = false;
        out << int(Value[i]);
    }
    if(Left) out << "0";
    out << std::endl;
}

int main()
{
    int N;
    std::cin >> N;
    for(int i = 0; i < N; ++i){
        std::string first, second;
        std::cin >> first;
        std::cin >> second;
        Print(Add(Decode(first), Decode(second)), std::cout);
    }
    return 0;
}