Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  string s,n,final;
  int o,c=0;
  cin>>s>>n;
  reverse(s.begin(),s.end());
  reverse(n.begin(),n.end());
  for(int i = 0; i < s.size() || i<n.size() || c;i++){
    o = (s.size() > i ? s[i]-'0' : 0) +(n.size() > i ? n[i]-'0' : 0) + c;

    //   o = (s[i]-'0')+(n[i]-'0')+c;
    c = o / 10;
    o %= 10;
    final.append(1,o+'0');
  }
  reverse(final.begin(),final.end());
  if(n.size()>=80 || s.size()>=80 || final.size()>=80) cout<<"overflow"<<endl;
  else cout<<final<<endl;
}

C++: #include <iostream>
#include <vector>
#include <cstdio>
#define N 10000
using namespace std;

char s[N];
vector<int> a,b;
int n, an,bn;

void pr( vector<int> a ){
  unsigned int i=0, len;
  while( a[i]==0 ) i++;

  len = a.size()-i;
  //  cout << "length : "<< len << endl;
  if( false && len>80 ){
    cout << "overflow";
  }else{
    for( ;i<a.size();i++ )
      cout << a[i];
  }
  cout << endl;
}

int main(){
  cin >> n;
  fgets( s,N,stdin );
  for( int loop=0;loop<n;loop++ ){
    a.clear();
    fgets( s,N,stdin );
    
    for( int i=0; s[i]!='\n' ;i++ )
      a.push_back( s[i]-'0' );
    b.clear();
    fgets( s,N,stdin );
    for( int i=0;s[i]!='\n';i++ )
      b.push_back( s[i]-'0' );
    an=a.size(); bn=b.size();

    while( an>bn ){
      b.insert( b.begin(),1, 0 ); bn++;
    }
    while( an<bn ){
      a.insert( a.begin(),1, 0 ); an++;
    }
    //    pr(a);
    //    pr(b);
    a.insert( a.begin(),1,0 );
    b.insert( b.begin(),1,0 );
    for( int i=an;i>=0;i-- ){
      a[i]+=b[i];
      if( a[i]>=10 ){
	a[i]-=10; a[i-1]++;
      }
    }
    pr( a );
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

#define int long long

typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}

string s,t;
string ans;
int tmp[222222];


void solve(){
    cin>>s>>t;
    ans=string();
    reverse(all(s));reverse(all(t));
    if(s.size()<t.size())s+=string(t.size()-s.size(),'0');
    if(t.size()<s.size())t+=string(s.size()-t.size(),'0');

    memset(tmp,0,sizeof(tmp));
    rep(i,s.size()){
        tmp[i]+=s[i]-'0'+t[i]-'0';
        tmp[i+1]+=tmp[i]/10;
        tmp[i]%=10;
    }

    rep(i,s.size()){
        ans+=string(1,'0'+tmp[i]);
    }
    if(tmp[s.size()])ans+=string(1,'0'+tmp[s.size()]);
    reverse(all(ans));

    if(ans.size()>80)cout<<"overflow"<<endl;
    else cout<<ans<<endl;
}

signed main(){
    int T;cin>>T;
    while(T--)solve();
}

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

void calc() {
    if (a.size() > 80 || b.size() > 80) { cout << "overflow" << endl; return; }
    if (b.size() > a.size()) swap(a, b);
    int a1, b1, size1 = a.size()-1, size2 = b.size()-1, mod = 0, sum;
    while (size1 >= 0 && size2 >= 0) {
        a1 = a[size1] - '0';
        b1 = b[size2] - '0';
        sum = a1 + b1 + mod;
        mod = (sum > 9) ? 1 : 0; sum %= 10;
        a[size1] = (char) '0' + sum;
        size1--; size2--;
    }
    while (size1 >= 0 && mod > 0) {
        a1 = a[size1] - '0';
        sum = a1 + mod;
        mod = (sum > 9) ? 1 : 0; sum %= 10;
        a[size1] = (char) '0' + sum;
        size1--;
    }
    if (mod > 0) a = "1" + a;
    if (a.size() > 80) cout << "overflow" << endl;
    else cout << a << endl;
}


int main()  {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a >> b;
        calc();
    }

}

C++: #include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl


int main(){
	li m;
	cin>>m;
	rep(k,m){
		string a,b;
		cin>>a>>b;
		li sa=sz(a),sb=sz(b);
		if(sa>sb)rep(i,sa-sb)b="0"+b;
		else rep(i,sb-sa)a="0"+a;
		
		//p2(a,b);
		
		li n=sz(a);
		li co=0;
		vector<li> res;
		
		for(li i=n-1; i>=0; i--){
			li tmp=((a[i]-'0')+(b[i]-'0'))+co;
			if(tmp>9){
				co=1;
				tmp-=10;
			}
			else co=0;
			
			res.pb(tmp);
		}
		if(co>0)res.pb(1);
		
		if(sz(res)>80)puts("overflow");
		else{
			rep(i,sz(res)){
				cout<<res[sz(res)-i-1];
			}
			puts("");
		}
	}
	
	return 0;
}

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

int main(){
  stack<int> n1,n2;
  int n,nn1,nn2,up,k,f,num[1000];
  char c;
  cin>>n;
  scanf("%c",&c);
  for(int i=0;i<n;i++){
    while(1){
      scanf("%c",&c);
      if(c=='\n')break;
      n1.push(c-'0');
    }
    while(1){
      scanf("%c",&c);
      if(c=='\n')break;
      n2.push(c-'0');
    }
    up=0;
    k=0;
    f=0;
    while(1){
      if(n1.size()!=0){
	nn1=n1.top();n1.pop();
      }else nn1=0;
      if(n2.size()!=0){
	nn2=n2.top();n2.pop();
      }else nn2=0;
      num[k]=(nn1+nn2+up)%10;
      up=(nn1+nn2+up)/10;
      if(n1.size()==0&&n2.size()==0&&up==0){
	break;
      }
      k++;
      if(k>=80)f=1;
    }
    if(f==1)cout<<"overflow";
    else {
      for(int i=k;i>=0;i--)cout<<num[i];
    }
    cout<<endl;
  }
  return 0;
}

C++: #include<iostream>
int main(){
int n;
cin>>n;
while(n--){
    long long int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
}
}

C++: #include<bits/stdc++.h>
using namespace std;
 
signed main(){
int a;
cin>>a;
for(int b=0;b<a;b++){
    int goukei[81]{};
    char c[110]{},d[110]{};
    scanf("%s%s",c,d);
    int e,f;
    e=strlen(c);f=strlen(d);
    if(e>80||f>80)puts("overflow");
   else{ e--;f--;
    for(int g=80;g!=0;g--,e--,f--){
	int s=goukei[g];
	if(e>-1)s+=c[e]-48;
	if(f>-1)s+=d[f]-48;
	goukei[g-1]=s/10;
	goukei[g]=s%10;
	}
	if(goukei[0])puts("overflow");
	else{
	    bool ss=false;
	    for(int m:goukei){
		if(m)ss=true;
		if(ss)printf("%d",m);
		}
		puts("");
	    }}
    }
}