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 <bits/stdc++.h>
using namespace std;

int main() {
    int num; cin >> num;
    for(int k = 0; k < num; k++) {
        string s1, s2, ret;
        vector<int> v1, v2;
        cin >> s1 >> s2;
        if(s2.length() > s1.length()) swap(s1,s2);

        for(int i=0; i<s1.length(); i++) v1.push_back((int)s1[i] - 48);
        for(int i=0; i<s2.length(); i++) v2.push_back((int)s2[i] - 48);
        reverse(v1.begin(), v1.end());
        reverse(v2.begin(), v2.end());

        int n = 0;
        for(int i=0; i<v2.size(); i++) {
            ret += to_string((v1[i] + v2[i] + n) % 10);
            if(v1[i] + v2[i] + n >= 10) n = 1;
            else n = 0;
        }
        for(int i=v2.size(); i<v1.size(); i++) {
            ret += to_string((v1[i] + n) % 10);
            if(v1[i] + n >= 10) n = 1;
            else n = 0;
        }

        if(v1.size() == v2.size() && v1[v1.size() - 1] + v2[v2.size() - 1] + n >= 10) ret += "1";
        else if(v1[v1.size() - 1] + n == 10) ret += "1";

        reverse(ret.begin(), ret.end());
        if(ret.length() > 80) cout << "overflow" << endl;
        else cout << ret << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define all(a) a.begin(),a.end()
using namespace std;

/*int main(){
	int n;
	cin>>n;
	rep(i,0,n){
		string s1,s2;
		cin>>s1>>s2;

		if(s1.size()<s2.size()) swap(s1,s2);

		for(int j=s1.size()-1,k=s2.size()-1;j>=0;j--,k--){
			if(k>=0) s1[j]+=s2[k]-'0';
			if(s1[j]>'9'){
				s1[j]-=10;
				if(s2)
			}
			ans[j]=a%10;
			ans[j+1]=a/10;
			//cout<<" "<<j<<" "<<ans[j]<<endl;
		}
		if(ans[80]>0){
			cout<<"overflow"<<endl; return 0;
		}
		bool f=0;
		for(int i=80;i>=0;i--){
			if(f==0 && ans[i]>0){
				f=1; cout<<ans[i];
			}else if(f) cout<<ans[i];
		}
		cout<<endl;
	}
}*/

int main(){
    int n;
    cin>>n;
    rep(i,0,n){
        int ans[85]={};
        vector<int> n1(80,0),n2(80,0);
        //rep(j,0,81)cout<<n1[j]<<" "<<n2[j]<<endl;
        string s1,s2; 
        cin>>s1>>s2;
        //cout<<s1<<" "<<s2<<endl;
        int sz1=s1.size(),sz2=s2.size();
 
        //rep(j,0,sz1) n1[j]=s1[sz1-1-j]-'0';
        //rep(j,0,sz2) n2[j]=s2[sz2-1-j]-'0';
 		
 		reverse(all(s1));
 		reverse(all(s2));

        rep(j,0,min((int)s1.size(),79)) n1[j]=s1[j]-'0';
        rep(j,0,min((int)s2.size(),79)) n2[j]=s2[j]-'0';

        reverse(all(n1));
        reverse(all(n2));

        for(int j=79;j>=0;j--){
           // cout<<"  "<<j<<" "<<n1[j]<<" "<<n2[j]<<endl;
            ans[j]+=n1[j]+n2[j];
            if(ans[j]>9){
            	if(j>0) {
            		ans[j-1]=1;
            		ans[j]-=10;
            	}
            }
            //cout<<" "<<j<<" "<<ans[j]<<endl;
        }
        if(ans[0]>9){
            cout<<"overflow"<<endl; break;
        }
        bool f=0;
        for(int j=0;j<80;j++){
            if(f==0 && ans[j]>0){
                f=1; cout<<ans[j];
            }else if(f||j==79) cout<<ans[j];
        }
        cout<<endl;
    }
}

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

int main(){
	
	int n;
	for(cin>>n;n--;){
		string a,b;
		cin>>a>>b;
		if(a.size()<b.size())swap(a,b);
		while(a.size()>b.size())b="0"+b;
		int f=0;
		for(int i=a.size()-1;i>=0;i--){
			a[i]+=(f+b[i]-'0');
			if(a[i]>'9'){
				f=1;
				a[i]-=10;
			}
			else f=0;
		}
		if(f)a="1"+a;
		if(a.size()>80){
			cout<<"overflow"<<endl;
			continue;
		}
		cout<<a<<endl;
		
		
	}
	
	return 0;
}

C++: /*
 * Problem     : AOJ0015
 * Title       : Integral
 * Author      : mizo0203
 * Status      : Accepted
 * Date        : Sun Jun 24 20:50:52
 * Copyright   : Your copyright free
 * Description : 文字列・多倍長演算
 */

#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;

int N;
char str1[81], str2[81];
int sum[80];

void init() {
  scanf("%d", &N);
}

bool input() {

  if (!N)
    return false;
  N--;

  scanf("%s", str1);
  scanf("%s", str2);

  return true;
}

int main() {
  int i, f;

  init();
  while (input()) {
    fill(sum, sum + 80, 0);
    for (i = 0; i < (int) strlen(str1); i++) {
      sum[i] = str1[strlen(str1) - i - 1] - '0';
    }
    f = 0;
    for (i = 0; i < (int) strlen(str2); i++) {
      sum[i] += str2[strlen(str2) - i - 1] - '0' + f;
      f = 0;
      if (sum[i] > 9) {
        sum[i] -= 10;
        f = 1;
      }
    }
    for (; i < 80; i++) {
      sum[i] += f;
      f = 0;
      if (sum[i] > 9) {
        sum[i] -= 10;
        f = 1;
      } else break;
    }
    if (f) {
      printf("overflow\n");
      continue;
    }
    for (i = 0; i < 79; i++) {
      if (sum[79 - i] != 0)
        break;
    }
    for (; i < 80; i++) {
      printf("%d", sum[79 - i]);
    }
    printf("\n");
  }

  return 0;
}

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;
}