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 <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cctype>
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <functional>
#include <stdexcept>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
const double PI = 3.141592653589793238462643383279502884L;
const int LARGE_INT = 1000000007;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define repfn(i,a,cont,next) \
  for(auto i = (a); [=](){return(cont);}(); i = [=](){return(next);}())
#define repby(i,a,b,s) repfn(i,a,i<b,i+s)
#define repab(i,a,b) repby(i,a,b,1)
#define rep(i,b) repab(i,0,b)
#define pb push_back
#define sz(c) int((c).size())

typedef vector<int> bignum;
const int max_digit = 80;

bignum operator+(const bignum& lhs, const bignum& rhs)
{
  int tmp, carry = 0;
  bignum res(max_digit, 0);
  for (int i = 0; i < max_digit; i++) {
    tmp = lhs[i] + rhs[i] + carry;
    if (tmp > 9) {
      carry = 1;
      res[i] = tmp % 10;
    } else {
      carry = 0;
      res[i] = tmp;
    }
  }
  if (carry)
    throw runtime_error("overflow");
  return res;
}

ostream& operator<<(ostream& os, const bignum& rhs)
{
  bool skip = true;
  rtr(rhs, i) {
    if (*i == 0 && skip)
      continue;

    skip = false;
    os << *i;
  }
  return os;
}

istream& operator>>(istream& is, bignum& rhs)
{
  string s;
  int i = 0;
  is >> s;
  rhs.assign(max_digit, 0);
  for (auto p = s.rbegin(); p != s.rend(); p++, i++) {
    rhs[i] = *p - '0';
  }
  if (sz(rhs) > max_digit)
    throw runtime_error("overflow");
  return is;
}

int main(int argc, char **argv)
{
  int n;
  bignum a, b;

  cin >> n;
    while (n--) {
      try {
        cin >> a >> b;
        cout << (a + b) << endl;
      } catch (runtime_error& re) {
        cout << re.what() << endl;
      }
    }
  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>

using namespace std;



int main(){
	int n;
	string x, y;
	int a, b, c;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> x >> y;
		if (x.length() > 80 || y.length() > 80){
			cout << "overflow" << endl;
		}
		else{
			a = stoi(x);
			b = stoi(x);
			if (to_string(a + b).length() > 80){
				cout << "overflow" << endl;
			}
			else cout << a + b << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int toNumber(char c){
	switch (c)
	{
	case '0': return 0;
	case '1': return 1;
	case '2': return 2;
	case '3': return 3;
	case '4': return 4;
	case '5': return 5;
	case '6': return 6;
	case '7': return 7;
	case '8': return 8;
	case '9': return 9;
	}
	return 0;
}
int main()
{
	int n, sa, sb, k, r, i;
	string a, b;
	int sum[81] = {};
	cin >> n;
	while (n--){
		cin >> a >> b;
		if (a.size() < b.size()) swap(a, b);
		sa = a.size();
		sb = b.size();
		k = i = 0;
		for (; i < sa; ++i){
			if (i < sb) k = toNumber(a[sa - 1 - i]) + toNumber(b[sb - 1 - i]) + k;
			else 		k = toNumber(a[sa - 1 - i]) + k;
			r = k % 10;
			k = k / 10;
			sum[i] = r;
		}
		if (0 != k) sum[i] = k;
		else --i;
		for (int d = i; d >= 0; --d)
			cout << sum[d];
		cout << "\n";
	}
	return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
  
using namespace std;
  
int main(){
      
    int n;
    cin>>n;
      
    while(n-- > 0){
        vector<int> ans;
        vector<int> a;
        vector<int> b;
          
        string c,d;
        cin>>c>>d;
          
        for(int i = 0; i < (int)c.size(); ++i){
            a.push_back(c[c.size()-1-i]-'0');
        }
        for(int i = 0; i < (int)d.size(); ++i){
            b.push_back(d[d.size()-1-i]-'0');
        }
          
          
        int kuri = 0;
        while(!a.empty() || !b.empty() || kuri!=0){
            int sum = kuri;
            kuri = 0;
              
            if(!a.empty()){
                sum += a[0];
                a.erase(a.begin());
            }
              
            if(!b.empty()){
                sum += b[0];
                b.erase(b.begin());
            }
              
            ans.push_back(sum%10);
            kuri += sum/10;
        }
          
        if(ans.size()>80)puts("overflow");
        else{
            for(int i = 0; i < (int)ans.size(); ++i){
                printf("%d",ans[ans.size()-1-i]);
            }puts("");
        }
    }
      
}
 
/*
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
 
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
     
    int n;
    cin >> n;
     
    while(n-- > 0){
     
    string str1;
    cin >> str1;
     
    string str2;
    cin >> str2;
     
    reverse(str1.begin(), str1.end());
    reverse(str2.begin(), str2.end());
     
    int check;
    if(str1.size() > str2.size()){
        check = 1;
    }
    else if(str1.size() == str2.size()){
        check = 2;
    }
    else {
        check = 3;
    }
     
    int ans[100];
    bool next = false;
    int short_ = min(str1.size(), str2.size());
    int long_ = max(str1.size(), str2.size());  
    if(long_ >= 80){
        cout << "overflow" << endl;
        continue;
    }
 
    for(int i = 0; i < short_; ++i){
        int num = 0;
        num += (str1[i] - '0') + (str2[i] - '0');
        if(next){
            num++;
        }
        ans[i] = num;
        next = false;   
        if(num >= 10){
            num -= 10;
            ans[i] -= 10;
            next = true;
        }
    }
     
    if(check == 1){
        for(size_t i = str2.size(); i < str1.size(); ++i){
            int num = str1[i] - '0';
            if(next){
                num++;
            }
            ans[i] = num;
            next = false;   
            if(num >= 10){
                num -= 10;
                ans[i] -= 10;
                next = true;
            }
        }
        if(next){
            ans[str1.size()] = 1;
            long_ ++;
        }
    }   
     
    if(check == 3){
        for(size_t i = str1.size(); i < str2.size(); ++i){
            int num = str2[i] - '0';
            if(next){
                num++;
            }
            ans[i] = num;
            next = false;   
            if(num >= 10){
                num -= 10;
                ans[i] -= 10;
                next = true;
            }
        }
        if(next){
            ans[str2.size()] = 1;
            long_ ++;
        }
    }
     
    if(long_ >= 80){
        cout << "overflow" << endl;
        continue;
    }
 
    for(int i = long_ - 1; i >= 0; --i){
        cout << ans[i];
    }   
    cout << endl;
    }
         
    return 0;
}