Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var n int
        var a, b string
        sc := bufio.NewScanner(os.Stdin)
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                sc.Scan()
                a = sc.Text()
                sc.Scan()
                b = sc.Text()

                if len(a) > len(b) {
                        s := add(a, b)
                        if s[len(a)] > 0 {
                                if len(a) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(a)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                } else {
                        s := add(b, a)
                        if s[len(b)] > 0 {
                                if len(b) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(b)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                }
        }
}

// expects ln > lm
func add(n string, m string) (s [100]int) {
        ln := len(n)
        lm := len(m)
        var sum [100]int

        for i := 0; i < ln; i++ {
                var s, t int
                s = int(n[ln-1-i]) - int('0')

                if lm - 1 - i >= 0 {
                        t = int(m[lm-1-i]) - int('0')
                } else {
                        t = 0
                }

                sum[i+1] = (s + t + sum[i]) / 10
                sum[i] = (s + t + sum[i]) % 10
        }

        return sum
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<cfloat>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

#define PI (3.1415926535)
#define EPS (1e-10)
class BigInteger{
private:
  void fromStr(const std::string &str){
    int len = str.size();
    int tmp = 0;

    if(str[0] == '+'){
      sign = 1;
      tmp=1;
    }else if (str[0] == '-'){
      sign = -1;
      tmp=1;
    }else{
      sign = 1;
    }

    nums = std::vector<char>(len-tmp);
    for(int i=0;i<len-tmp;i++){
      nums[i]=str[len-1-i]-'0';
    }
  }
public:
  std::vector<char> nums;
  char sign;
  /*
   * constructors
   */
  BigInteger(){sign = 1;nums = std::vector<char>(1,0);}
  BigInteger(const std::vector<char> n,char s){
    nums = n;
    assert(s == 1 || s == -1);
    sign = s;
  }
  BigInteger(const std::string &str){
    fromStr(str);
  }
  BigInteger(int n){
    char buff[16];
    sprintf(buff,"%d",n);
    fromStr(std::string(buff));
  }

  int size() const{
    return nums.size();
  }
  int len() const{
    return nums.size();
  }

  char operator [] (int n) const{
    if(n<size() && n>=0)
      return nums[n];
    else
      return 0;
  }

  const std::vector<char> &vec() const{
    return nums;
  }
  char sig() const{
    return sign;
  }
  
  std::string toString() const{
    std::string ret="";
    if(sign == -1) ret+="-";
    for(int i=nums.size()-1;i>=0;i--){
      ret+=nums[i]+'0';
    }
    return ret;
  }

  void debug() const{
    std::cout << "sign =" << (int)sign << std::endl;
    for(int i=nums.size()-1;i>=0;i--){
      std::cout << (int)nums[i] << " ";
    }
    std::cout << std::endl;
  }
};

std::ostream &operator << (std::ostream &s , const BigInteger &i){
  return s << i.toString();
}

bool operator > (const BigInteger &a,const BigInteger &b){
  char as = a.sig();
  char bs = b.sig();
  if(as == 1 && bs ==1){
    if(a.len() == b.len()){
      int i=a.len();
      while(--i != -1){
        if(a[i] != b[i]){
          return a[i] > b[i];
        }
      }
      return false;
    }else{
      return a.len() > b.len();
    }
  }else if(as == -1 && bs == -1){
    if(a.len() == b.len()){
      int i=a.len();
      while(--i != 0){
        if(a[i] != b[i]){
          return a[i] < b[i];
        }
      }
      return false;
    }else{
      return a.len() < b.len();
    }
  }else{
    return as == 1;
  }
}
bool operator < (const BigInteger &a,const BigInteger &b){
  return b > a;
}
bool operator == (const BigInteger &a,const BigInteger &b){
  char as = a.sig();
  char bs = b.sig();
  if(as != bs) return false;

  if(a.len() != b.len()){
    return false;
  }else{
    for(int i=0;i<a.len();i++){
      if(a[i]!=b[i]) return false;
    }
  }
  return true;
}

bool operator != (const BigInteger &a,const BigInteger &b){
  return !(a==b);
}

/* operator */
BigInteger operator - (const BigInteger &a){
  return BigInteger(a.vec(),-a.sig());
}

BigInteger operator + (const BigInteger &a,const BigInteger &b){
  int lena = a.size();
  int lenb = b.size();
  int maxlen = std::max(lena,lenb);
  std::vector<char> v = std::vector<char>(maxlen+1,0);
  int sig = 1;

  for(int i=0;i<maxlen;i++){
    v[i] += a.sig()*a[i]+b.sig()*b[i];
    while(v[i] < 0){
      v[i+1]--;
      v[i]+=10;
      std::cout << "test" << std::endl;
    }
    if(v[i] >=10){
      v[i+1] = v[i]/10;
      v[i]%=10;
    }
  }

  if(v[maxlen]<0){
    sig = -1;
    for(int i=0;i<maxlen;i++){
      v[i]=-v[i];
      while(v[i]<0){
        v[i+1]++;
        v[i]+=10;
      }
    }
    v[maxlen]=-v[maxlen];
  }

  int pos=v.size();
  while(pos!=1 && v[pos-1]==0) pos--;
  if(pos != v.size()) v.resize(pos);
  
  return BigInteger(v,sig);
}

BigInteger operator + (const BigInteger &a,int b){
  return a+BigInteger(b);
}


BigInteger &operator += (BigInteger &a,const BigInteger &b){
  a = a+b;
  return a;
}
BigInteger &operator += (BigInteger &a,int b){
  a = a+b;
  return a;
}

BigInteger &operator ++ (BigInteger &a){
  a = a + BigInteger(1);
  return a;
}

BigInteger operator - (const BigInteger &a,const BigInteger &b){
  return a + (- b); 
}

BigInteger operator * (const BigInteger &a,const BigInteger &b){
  int len = a.size() + b.size() + 2;
  int sign = a.sig()*b.sig();

  std::vector<char> v(len);

  for(int i=0;i<a.size();i++){
    if(a[i] == 0) continue;
    for(int j=0;j<b.size();j++){
      v[i+j] += a[i]*b[j];
      if(v[i+j] >=10){
        v[i+j+1] = v[i+j]/10;
        v[i+j]%=10;
      }
    }
  }

  int pos=v.size();
  while(pos!=1 && v[pos-1]==0) pos--;
  if(pos != v.size()) v.resize(pos);

  return BigInteger(v,sign);
}

BigInteger operator * (const BigInteger &a,int b){
  return a*BigInteger(b);
}

BigInteger &operator *= (BigInteger &a,const BigInteger &b){
  a = a*b;
  return a;
}
BigInteger &operator *= (BigInteger &a,int b){
  a = a*b;
  return a;
}

BigInteger reverse(const BigInteger &a){
  BigInteger b=a;
  std::reverse(b.nums.begin(),b.nums.end());
  return b;
}

BigInteger power(BigInteger a,int b){
  if(b == 0) return BigInteger(1);
  if((b&1) != 0){
    return a*power(a*a,b>>1);
  }else{
    return power(a*a,b>>1);
  }
}

int main(){
  int n; cin>>n;
  while(n-->0){
    string s1,s2;
    cin>>s1>>s2;
    BigInteger b1(s1), b2(s2);
    cout << b1+b2 << endl;
  }
  return 0;
}