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

using namespace std;

int main (void) {
    int N;
    cin >> N;
    while (N--) {
        string s1, s2;
        cin >> s1;
        cin >> s2;
        vector<int> n1, n2, res;
        for (int i = s1.size(); i--;) {
            n1.push_back((int)(s1[i] - '0'));
        }
        for (int i = s2.size(); i--;) {
            n2.push_back((int)(s2[i] - '0'));
        }
        if (n1.size() < n2.size()) {
            for (int i = n1.size(); i < n2.size(); i++) {
                n1.push_back(0);
            }
        } else if (n2.size() < n1.size()) {
            for (int i = n2.size(); i < n1.size(); i++) {
                n2.push_back(0);
            }
        }
        int s, c = 0;
        for (int i = 0; i < n1.size(); i++) {
            s = n1[i] + n2[i] + c;
            res.push_back(s % 10);
            c = s / 10;
        }
        if (c != 0) {
            res.push_back(c);
        }
        int size = res.size();
        while (size > 0 && res[size - 1] == 0) {
            size--;
        }
        if (size > 80) {
            cout << "overflow" << endl;
        } else {
            int i = size;
            while (i--) {
                cout << res[i];
            }
            cout << endl;
        }
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#define max(a,b) a>b?a:b
using namespace std;
int che(char a){
	char i;
	int j=0;
	for(i='0';i<='9';i++){
		if(a==i){
			return j;
		}
		j++;
	}
	return 0;
}
char cha(int a){
	char i;
	int j=0;
	for(i='0';i<='9';i++){
		if(j==a){
			return i;
		}
		j++;
	}
}
int main(){
	string a,b;
	int c=0;
	int i,j,k,m,n;
	int x,y;
	char d[200];
	cin>>n;
	for(k=0;k<n;k++){
		cin>>a>>b;
		x=a.size();
		y=b.size();
		m=max(x,y);
		for(i=1;i<=m;i++){
			j=che(a[x-i])+che(b[y-i])+c;
			if(j>=10){
				c=1;
				j-=10;
			}else{
				c=0;
			}
			d[i]=cha(j);
		}
		if(c==1){
			d[i]=cha(1);
			c=0;
			i++;
		}
		if(i>80){
			cout<<"overflow"<<endl;
			continue;
		}
		for(j=i-1;j>0;j--){
			cout<<d[j];
		}
		cout<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
	string a,b;
	vector<int> ans;
	int n,tmp,carry,num;
	cin >> n;
	for(int i=0; i<n; i++){
		ans.clear();
		cin >> a >> b;
		int ai = a.size()-1;
		int bi = b.size()-1;
		carry=0;
		if(a.size() > 80 || b.size() > 80){
			cout << "overflow" << endl;
			return 0;
		}
		while(ai >= 0 || bi >= 0){
			tmp=0;
			if(ai >= 0) tmp += a[ai] - '0';
			if(bi >= 0) tmp += b[bi] - '0';
			ans.push_back((tmp+carry)%10);
			carry = (tmp+carry)/10;
			ai--; bi--;
		}
		if(carry != 0) ans.push_back(carry);
		if(ans.size() > 80){
			cout << "overflow" << endl;
			return 0;
		}
		
		for(int j=ans.size()-1; j>=0; j--)
			cout << ans[j];
		cout << endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n;
	string a,b;
	cin >> n;
	while(n--) {
		cin >> a >> b;
		string ret = "";
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		int a_len = a.size(),b_len = b.size();
		int num = max(a_len,b_len),carry = 0,v;
		char tmp[1];
		for(int i = 0; i < num; i++) {
			if(a_len <= i || b_len <= i) v = carry + (b_len <= i ? a[i] : b[i]) - '0';
			else v = carry + a[i] + b[i] - '0' * 2;
			carry = v / 10;
			sprintf(tmp,"%d",v % 10);
			ret += tmp;
		}
		sprintf(tmp,"%d",carry);
		if(carry != 0) ret += tmp;
		reverse(ret.begin(),ret.end());
		cout << (ret.size() > 80 ? "overflow" : ret) << 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]);
    }
    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;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <deque>
class BigInt
{
  std::deque<char> m_digits;
public:
  BigInt(std::string str) {
    for(auto it = str.begin(); it != str.end(); ++it) {
      m_digits.push_back(*it - '0');
    }
  }

  BigInt(int num) {
    std::ostringstream oss;
    oss << num;
    BigInt(oss.str());
  }

  std::string str() const {
    std::string str;
    for (auto it = m_digits.begin(); it != m_digits.end(); ++it) {
      str += *it + '0';
    }
    return str;
  }

  const BigInt& operator +=(const BigInt& rhs) {
    std::deque<char> new_digits;
    auto lhs_rit = m_digits.rbegin();
    auto rhs_rit = rhs.m_digits.rbegin();

    char inc = 0;
    while (lhs_rit != m_digits.rend() &&
           rhs_rit != rhs.m_digits.rend()) {
      char temp = *lhs_rit + *rhs_rit;
      temp += inc;
      if (temp >= 10) {
        inc = temp / 10;
        temp -= inc * 10;
      }
      new_digits.push_front(temp);
      ++lhs_rit;
      ++rhs_rit;
    }

    if (lhs_rit != m_digits.rend()) {
      while (lhs_rit != m_digits.rend()) {
        char temp = *lhs_rit + inc;
        if (temp >= 10) {
          inc = temp / 10;
          temp -= inc * 10;
        } else {
          inc = 0;
        }
        new_digits.push_front(temp);
        ++lhs_rit;
      }
    }
    else if (rhs_rit != rhs.m_digits.rend()) {
      while (rhs_rit != rhs.m_digits.rend()) {
        char temp = *rhs_rit + inc;
        if (temp >= 10) {
          inc = temp / 10;
          temp -= inc * 10;
        } else {
          inc = 0;
        }
        new_digits.push_front(temp);
        ++rhs_rit;
      }
    }
    if (inc > 0) new_digits.push_front(inc);
    m_digits = new_digits;
  }
};

BigInt operator +(const BigInt& lhs, const BigInt& rhs)
{
  BigInt result(lhs);
  result += rhs;
  return result;
}

int main()
{
  int n;
  std::cin >> n;
  while (n--) {
    std::string num;
    std::cin >> num;
    BigInt num1(num);
    std::cin >> num;
    BigInt num2(num);
    
    BigInt num3 = num1 + num2;
    std::cout << num3.str() << std::endl;
  }
  return 0;
}