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 <stdio.h>
#include <string.h>

class overflow {
public:
	overflow() {};
};

class BigNum {
public:
	BigNum() : c(0), keta(0), size(0) {} ;

	BigNum(int n) : keta(0) {
		size = n;
		c = new char [size];
		memset(c, 0, size);
	};

	BigNum(const char* buf) {
		keta = strlen(buf);
		if (buf[keta-1] == '\n') {
			keta --;
		}
		if (keta > 80) {
			throw overflow();
		}
		size = keta;
		c = new char [size];
		int k = 0;
		for (int i = keta - 1; i >= 0; i--) {
			c[k++] = buf[i] - '0';
		}
	};

	BigNum(BigNum& b) {
		size = b.size;
		keta = b.keta;
		c = new char [size];
		memcpy(c, b.c, size);
	};

	BigNum& operator=(const BigNum& b) {
		size = b.size;
		keta = b.keta;
		c = new char [size];
		memcpy(c, b.c, size);

		return *this;
	};

	~BigNum() {
		if (c) {
			delete [] c;
		}
	};

	BigNum add(BigNum& n) {
		BigNum* a;
		BigNum* b;

		if (keta > n.keta) {
			a = this;
			b = &n;
		} else {
			a = &n;
			b = this;
		}

		BigNum r(a->keta + 1);

		int h;
		int m = 0;
		int i;
		for (i = 0; i < a->keta; i++) {
			if (i <= b->keta) {
				h = a->c[i] + b->c[i] + m;
				m = h / 10;
				r.c[i] = h % 10;
			} else {
				h = a->c[i] + m;
				m = h / 10;
				r.c[i] = h % 10;
			}
		}
		if (m > 0) {
			r.c[i] = m;
			r.keta = i+1;
		} else {
			r.keta = i;
		}
		
		if (r.keta > 80) {
			throw overflow();
		}

		return r;
	};

	void print(void) const {
		for (int i = keta - 1; i >= 0; i --) {
			printf("%d", c[i]);
		}
		printf("\n");
	};

	char* c;
	int keta;

private:
	size_t size;
};

int
main(void)
{
	char line[100];
	int n;

	if (fgets(line, sizeof line, stdin) == NULL) {
		return 1;
	}
	if (sscanf(line, "%d", &n) != 1) {
		return 1;
	}

	try {
		for (int i = 0; i < n; i++) {
			if (fgets(line, sizeof line, stdin) == NULL) {
				return 1;
			}
			BigNum a(line);

			if (fgets(line, sizeof line, stdin) == NULL) {
				return 1;
			}
			BigNum b(line);

			BigNum r;
			r = a.add(b);

			r.print();
		}
	}
	catch (overflow) {
		printf("overflow\n");
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;++i){
		string a,b,c;
		int d=0,st;
		cin>>a>>b;
		for(int j=a.size();j<81;++j) a="0"+a;
		for(int j=b.size();j<81;++j) b="0"+b;
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		for(int j=0;j<80;++j){
			c+=((a[j]-'0')+(b[j]-'0')+d)%10+'0';
			d=((a[j]-'0')+(b[j]-'0')+d)/10;
		}
		if(d) cout<<"overflow\n";
		else{
			reverse(c.begin(), c.end());
			for(st=0;st<c.size();++st)if(c[st]!='0')break;
			cout<<((st==c.size())?"0":c.substr(st,c.size()-st))<<"\n";
		}
	}
	return 0;
}

C++: #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
	char num1[1002],num2[1002];
	int a1[1002],a2[1002],ans[1002];
	int i,j,n,k,l1,l2,kuriagari=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		for(j=0;j<1002;j++)
		{
			num1[j]='\0';
			num2[j]='\0';
			a1[j] = 0;
			a2[j] = 0;
			ans[j] = 0;
		}
		scanf("%s",num1);
		scanf("%s",num2);
		l1 = strlen(num1);
		l2 = strlen(num2);
		for(j=0;j<l1;j++)
		{
			a1[j] = num1[l1-1-j] - '0';
		}
		for(j=0;j<l2;j++)
		{
			a2[j] = num2[l2-1-j] - '0';
		}
		for(j=0;j<1002;j++)
		{
			ans[j] = (a1[j] + a2[j] + kuriagari) % 10;
			if((int)((a1[j] + a2[j] + kuriagari)/10) == 1)
			{
				kuriagari = 1;
			}
			else
			{
				kuriagari = 0;
			}
		}
		if(ans[1000] != 0)
		{
			printf("overflow\n");
		}
		else
		{
			for(j=1001;j>=0;j--)
			{
				if(ans[j] != 0)
				{
					k = j;
					break;
				}
			}
			for(j=k;j>=0;j--)
			{
				printf("%d",ans[j]);
			}
			printf("\n");
		}
	}
	return 0;
}