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 <stdio.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <algorithm>
#include <set>
#define INF 10000000
using namespace std;
typedef pair<int,int> P;

int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    string str1,str2;
    cin >> str1 >> str2;
    if(str1.size()>str2.size()){
      string temp = str1;
      str1 = str2;
      str2 = temp;
    }

    int len1 = str1.size(),len2 = str2.size();
    int kuriagari = 0;
    for(int j=1;len2-j>=0;j++){
      if(len1-j>=0){
        int sum = (str2[len2-j]-'0') + (str1[len1-j]-'0') + kuriagari;
        if(sum>=10){
          sum -=10;
          kuriagari = 1;
        }else{
          kuriagari = 0;
        }
        str2[len2-j] = sum+'0';
      }else{
        if(kuriagari){
          int sum = (str2[len2-j]-'0') + kuriagari;
          if(sum>=10){
            sum -=10;
            kuriagari = 1;
          }else{
            break;
          }
          str2[len2-j] = sum+'0';
        }else{
          break;
        }
      }
    }
    if(kuriagari){
      str2 = "1" + str2;
    }
    if(str2.size()>80){
      cout << "overflow" << endl;
    }else{
      cout << str2 << endl;
    }
  }
}

C++: #include <iostream>
#include <cstring>

using namespace std;

int A[1000],B[1000],C[1000];

int main()
{
    int n;
    cin >> n;
    while(n > 0)
    {
        n--;
        string str1,str2;
        cin >> str1 >> str2;
        int len1 = str1.length();
        int len2 = str2.length();
        if(len1 < len2)
        {
            string st = str1;
            str1 = str2;
            str2 = st;
            int ll = len1;
            len1 = len2;
            len2 = ll;
        }
        for(int i = 0; i < 1000; i++)
        {
            C[i] = 0;
            A[i] = 0;
            B[i] = 0;
        }

        for(int i = 0; i < len1; i++)
            A[i] = str1[len1 - 1 - i] - '0';
        for(int i = 0; i < len2; i++)
            B[i] = str2[len2 - 1 - i] - '0';
        for(int i = 0 ; i < len1; i++)
        {
            C[i] = A[i] + B[i] + C[i];
            C[i+1] = C[i] / 10;
            C[i] = C[i] % 10;
        }
        //for(int i = len2; i <len1; i++)
       // {
           //  C[i] = C[i] + A[i];
           //  C[i+1] = C[i] / 10;
          //   C[i] = C[i] % 10;
       // }


        if(C[80] > 0)
            cout << "overflow" << endl;
        else
            {
                if(C[len1] > 0)
                    len1++;
                for(int i = len1-1; i >= 0; i--)
                    cout << C[i];
                cout << endl;
            }
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(){
	int n;
	cin>>n;
	for(int i=0; i<n; i++){
		string a, b;
		cin>>a>>b;
		int kuri = 0;
		int k = 0;
		string ans = "";
		while(true){
			bool breakflg = true;
			int ai = 0;
			int bi = 0;
			if(int(a.size())-k-1 >= 0){
				ai = a[int(a.size())-k-1] - '0';
				breakflg = false;
			}
			if(int(b.size())-k-1 >= 0){
				bi = b[int(b.size())-k-1] - '0';
				breakflg = false;
			}
			k++;
			int sum = ai + bi + kuri;
			if(sum>9){
				kuri = 1;
				sum %= 10;
			} else {
				kuri = 0;
			}
			ans.push_back('0'+sum);
			if(!kuri&&breakflg) break;
		}
		reverse(ans.begin(), ans.end());
		while(true){
			if(ans.size()==1) break;
			if(ans[0]=='0'){
				ans = ans.substr(1);
			} else {
				break;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;


int main(){
  int n,i,j;
  string a,b;
  int sum[110]={};
  int up = 0;
  cin >> n;
  for(i=0;i<n;i++){
    cin >> a >> b;
    int sa=a.size(),sb=b.size();
    for(j=0;j<max(sa,sb);j++){
      if(sa>j&&sb>j){
	sum[j] = (a[sa-j-1]-'0') + (b[sb-j-1]-'0') + up;
      }else if(sa>j){
	sum[j] = (a[sa-j-1]-'0') + up;
      }else if(sb>j){
	sum[j] = (b[sb-j-1]-'0') + up;
      }
      up=0;
      if(sum[j]>9){
	up=1;
	sum[j]-=10;
      }
    }
    sum[max(sa,sb)]=up;
    int k=110-1;
    while(sum[k]==0&&k>0) k--;
    if(k>=80) cout << "overflow";
    else
    for(j=k;j>=0;j--)
      cout << sum[j];
    cout << endl;
  }
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <complex>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<double> VEC;
typedef vector<VEC> MAT;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))
#define T1 first
#define T2 second.first
#define T3 second.second.first
#define T4 second.second.second

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define EPS 1.0e-9

inline int getnum(string s, int idx){
	if(idx >= s.size())return 0;
	else return s[idx]-'0';
}

string add(string s, string t){
	reverse(ALL(s));
	reverse(ALL(t));
	int n=max(s.length(), t.length());
	string r;
	int ku=0;
	REP(i,n){
		int tmp = getnum(s, i)+getnum(t,i)+ku;
		r.PB(tmp%10+'0');
		if(tmp>9)ku=1;
		else ku=0;
	}
	if(ku)r.PB('1');
	reverse(ALL(r));
	return r;
}

int main(){
	int t;
	cin >> t;
	REP(i,t){
		string s1,s2;
		cin>>s1>>s2;
		cout << add(s1,s2) << endl;
	}

	return 0;
}