Problem:


National Budget

A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647.

Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.

If given integers or the sum have more than 80 digits, print "overflow".

Input

Input consists of several datasets. In the first line, the number of datasets N (1 ≤ N ≤ 50) is given. Each dataset consists of 2 lines:

The first integer
The second integer

The integer has at most 100 digits.

Output

For each dataset, print the sum of given integers in a line.

Sample Input

6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000

Output for the Sample Input

1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow



Sample input:
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000


Sample output:
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow

Submission status: Accepted

Solution code:
num = int(input())

for i in range(num):
    total = int(input()) + int(input())
    if len(str(total)) > 80:
        print("overflow")
    else:
        print(total)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    answers = []
    for _ in range(n):
        a = input()
        b = input()
        la, lb = len(a), len(b)
        if la > 80 or lb > 80:
            answers.append("overflow")
            continue
        if la > lb:
            ll = la
            for _ in range(la-lb):
                b = "0" + b
        else:
            ll = lb
            for _ in range(lb-la):
                a = "0" + a
        ans = ""
        bl = 0
        for i in range(ll):
            tmp = int(a[ll-i-1]) + int(b[ll-i-1]) + bl
            if tmp >= 10:
                bl = 1
                tmp = tmp % 10
            else:
                bl = 0
            ans = str(tmp) + ans
        if bl == 1:
            ans = "1" + ans
        if len(ans) > 80:
            answers.append("overflow")
            continue
        answers.append(ans)
    print(*answers, sep="\n")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
p = int(input())
for j in range(p):
    a, b = int(input()), int(input())
    x = str(a+b)
    print("overflow" if len(x)>80 else a+b)

Submission status: Accepted

Solution code:
N = int(input())
A = []
B = []
for i in range(N):
    a = int(input())
    b = int(input())
    A.append(a)
    B.append(b)

for i in range(N):
    if A[i] >= 10 ** 80 or B[i] >= 10 ** 80:
        print("overflow")
    elif A[i] + B[i] >= 10 ** 80:
        print("overflow")
    else:
        print(str(A[i] + B[i]))

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    s = int(input()) + int(input())
    if(len(str(s)) <= 80):
        print (s)
    else:
        print ('overflow')

Submission status: Accepted

Solution code:
import sys

n = int(input())
for _ in range(n):
    a = sys.stdin.readline()
    b = sys.stdin.readline()
    c = int(a) + int(b)
    if len(str(c)) > 80:
        print("overflow")
    else:
        print(c)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    a = int(input())
    b = int(input())
    if len(str(a + b)) > 80:
        print("overflow")
    else:
        print(str(a + b))

Submission status: Accepted

Solution code:
import math

n = int(input());

for i in range(n):
    
    num1 = int(input());
    num2 = int(input());
    total = num1 + num2;

    if len(str(total)) > 80:
        print("overflow");
    else:
        print(total);

Submission status: Accepted

Solution code:
import math

n = int(input());

for i in range(0,n):
    
    num1 = int(input());
    num2 = int(input());
    total = num1 + num2;

    if len(str(total)) > 80:
        print("overflow");
    else:
        print(total);

Submission status: Accepted

Solution code:
# Aizu Problem 0015: National Budget
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


N = int(input())
for n in range(N):
    a = int(input())
    b = int(input())
    budget = a + b
    print(budget if len(str(budget)) <= 80 else "overflow")

Submission status: Accepted

Solution code:
t=int(input())
for num in range(t):
	a=int(input())
	b=int(input())
	if len(str(a))<=80 and len(str(b))<=80 and len(str(a+b))<=80:
		print(a+b)
	else:
		print("overflow")

Submission status: Accepted

Solution code:
N = int(input())
import re
for _ in [0]*N:
    a = input().zfill(100)
    b = input().zfill(100)
    result = []
    prev = 0
    for i in range(1, 81):
        n = int(a[-i]) + int(b[-i]) + prev
        result.append(n%10)
        prev = n // 10
    if prev > 0 or int(a[:-80]) + int(b[:-80]) > 0:
        print("overflow")
    else:
        result = "".join(map(str, result[::-1]))
        print(int(result))

Submission status: Accepted

Solution code:
# coding:utf-8
for i in range(int(input())):
	a,b =int(input()),int(input())
	if a>=pow(10,80) or b>=pow(10,80):
		print("overflow")
	else:
		big = a+b
		if big >= pow(10,80):
			print("overflow")
		else:
			print(big);

Submission status: Accepted

Solution code:
N = int(input())
for _ in range(N):
    f, s = [int(input()) for _ in range(2)]
    print(f+s if len(str(f+s)) <= 80 else "overflow")

Submission status: Accepted

Solution code:
import math
count=int(input())
for i in range(count):
    x=int(input())
    y=int(input())
    ans=x+y
    dif=100000000000000000000000000000000000000000000000000000000000000000000000000000000
    if ans>=dif:
        print("overflow")
    else:
        print(ans)

Submission status: Accepted

Solution code:

if __name__ == '__main__':
    n = (int)(input())
    for _ in range(n):
        sNumber = (int)(input())
        tNumber = (int)(input())
        uNumber = sNumber+tNumber
        print("overflow" if uNumber >= 10**80 else uNumber)

Submission status: Accepted

Solution code:
n = int(input())
for _ in range(n):
    a = input()
    b = input()
    c = int(a) + int(b)
    if len(str(c)) > 80:
        print("overflow")
    else:
        print(c)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-

n = input()
for i in range(1, n + 1):
    a = long(raw_input())
    b = long(raw_input())
    c = a + b
    d = c
    digit = 0
    while c > 0:
        c = c / 10
        digit += 1

    if digit > 80:
        print 'overflow'
    else:
        print d

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    Upper = 10**80
    for i in range(n):                       
            a = int(input())
            b = int(input())
            if a+b >= Upper:
                print("overflow")
            else:
                print(a+b)
if __name__ =='__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
for i in range(0, n) :
  a = int(input())
  b = int(input())
  sum = a + b
  if len(str(sum)) > 80 :
    print("overflow")
  else :
    print(sum)

Submission status: Accepted

Solution code:
for i in range(int(input())):
  ans = int(input()) + int(input())
  print(ans if len(str(ans)) <= 80 else "overflow")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
	a = int(input())
	b = int(input())
	
	if (a+b) < (10**80):
		print(a+b)
	else:
		print("overflow")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    x = int(input())
    y = int(input())
    if len(str(x + y)) > 80:
        print("overflow")
    else:
        print(x + y)

Submission status: Accepted

Solution code:
import math

def calc_digit(data1, data2):
    if(data1 == 0):
        data_size2 = int(len(str(data2)))
        data_size1 = 1
    elif(data2 == 0):
        data_size1 = int(len(str(data2)))
        data_size2 = 1
    else:
        data_size1 = int(len(str(data1)))
        data_size2 = int(len(str(data2)))
    return(data_size1, data_size2)

def two_number_sum(data1, data2):
    result = data1 + data2
    if int(len(str(result))) > 80:
        print("overflow")
    else:
        print(result)

def main():
    a = []
    N = int(input())
    for i in range(N*2):
        a.append(input())
    for i in range(0, N*2):
        if i % 2 == 0:
            continue
        else:
            data1 = int(a[i-1])
            data2 = int(a[i])
            if(data1 == None):
                data1 = 0
            elif(data2 == None):
                data2 = 0
            x, y = calc_digit(data1, data2)
            if(x > 80 or y > 80):
                print("overflow")
                continue
            two_number_sum(data1, data2)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(raw_input())
for i in range(0,n):
    #a,b=map(int,raw_input().splitlines())
    a = int(raw_input())
    b = int(raw_input())
    sum = a+b
    if len(str(sum)) <= 80:
        print sum
    else:
        print "overflow"

Submission status: Accepted

Solution code:
# coding: utf-8

n = int(raw_input())

for i in range(n):
	n1 = int(raw_input())
	n2 = int(raw_input())
	sum = n1 + n2
	strsum = str(sum)
	if len(strsum) > 80:
		print("overflow")
	else:
		print(strsum)

Submission status: Accepted

Solution code:
N = int(input())
for _ in range(N):
    a = int(input())
    b = int(input())
    c = a + b
    length = len(str(c))
    print([c, "overflow"][length > 80])

Submission status: Accepted

Solution code:
N = int(input())
for i in range(N):
    a = int(input())
    b = int(input())
    ans = a + b
    if len(str(ans)) > 80:
        print("overflow")
    else:
        print(ans)

Submission status: Accepted

Solution code:
for _ in[0]*int(input()):
 s=int(input())+int(input())
 print([s,'overflow'][s>=10**80])

Submission status: Accepted

Solution code:
for _ in[0]*int(input()):
 s=eval(input()+'+'+input())
 print([s,'overflow'][s>=10**80])

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
	x = int(input())
	y = int(input())
	ans = x + y
	if(ans < 10**80):
		print(ans)
	else:
		print("overflow")

Submission status: Accepted

Solution code:

n=int(input())
for _ in range(n):
    a=input()
    b=input()
    s=int(a)+int(b)
    if len(a)>80 or len(b)>80 or len(str(s))>80:
        print("overflow")
        continue
    else:
        print(s)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
  a = int(input())
  b = int(input())
  c = a + b
  if len(str(c)) > 80:
    print("overflow")
  else:
    print(c)

Submission status: Accepted

Solution code:
for _ in range(int(input())):
    a = int(input()) + int(input())
    print(a if len(str(a)) < 81 else "overflow")

Submission status: Accepted

Solution code:
o=map(str,[sum([int(input()) for j in range(2)]) for i in range(int(input()))])
[print(i) if len(i)<=80 else print("overflow") for i in o]

Submission status: Accepted

Solution code:
[print(i) if len(i)<=80 else print("overflow") for i in map(str,[sum([int(input()) for j in range(2)]) for i in range(int(input()))])]

Submission status: Accepted

Solution code:
# AOJ 0015 National Budget
# Python3 2018.6.9 bal4u

n = int(input())
for i in range(n):
    a = str(input())
    b = str(input())
    if len(a) > 80 or len(b) > 80:
        print('overflow')
    else:
        s = str(int(a)+int(b))
        if len(s) <= 80:
            print(s)
        else:
            print('overflow')

Submission status: Accepted

Solution code:
# AOJ 0015 National Budget
# Python3 2018.6.9 bal4u

n = int(input())
for i in range(n):
    s = int(input()) + int(input())
    if len(str(s)) <= 80:
        print(s)
    else:
        print('overflow')

Submission status: Accepted

Solution code:
n = int(input())
for _ in range(n):
    a = int(input())+int(input())
    if a >= 10**80:
        print("overflow")
    else:
        print(a)

Submission status: Accepted

Solution code:
n = int(raw_input())
for i in range(0, n):
    x = int(raw_input())
    y = int(raw_input())
    sum = str(x+y)
    if len(sum) > 80:
        print 'overflow'
    else:
        print sum

Submission status: Accepted

Solution code:
count =int(input())
for a in range(count):
  x,y=int(input()),int(input())
  ans = str(x+y)
  if len(ans) >80:print "overflow"
  else:
    print ans

Submission status: Accepted

Solution code:
line_num = int(raw_input())
for n in range(line_num):
	a = raw_input()
	b = raw_input()
	if len(a) > 80 or len(b) > 80:
		print 'overflow'
	else:
		filled_a, filled_b = a.zfill(80), b.zfill(80)
		rlist_a = map(int,list(filled_a)[::-1])
		rlist_b = map(int,list(filled_b)[::-1])
		rlist_sum = []
		for n in range(80):
			rlist_sum.append(rlist_a[n]+rlist_b[n])
		for n in range(79):
			if rlist_sum[n] > 9:
				rlist_sum[n] -= 10
				rlist_sum[n+1] += 1
		if rlist_sum[79] > 9:
			print 'overflow'
		else:
			list_sum = []
			f = 0
			for n in rlist_sum[::-1]:
				if f > 0:
					list_sum.append(n)
				else:
					if n > 0:
						f = 1
						list_sum.append(n)
			ans = ''.join(map(str,list_sum))
			if len(ans) < 1:
				print '0'
			else:
				print ans

Submission status: Accepted

Solution code:
n=input()
for i in xrange(n):
    a=input()
    b=input()
    sum=str(a+b)
    if len(sum)>80:
        print "overflow"
    else :
        print sum

Submission status: Accepted

Solution code:
ds = int(raw_input())
for i in xrange(ds):
    x=int(raw_input())
    y=int(raw_input())
    sum = str(x+y)
    if len(sum) > 80:
        print "overflow"
    else:
        print sum

Submission status: Accepted

Solution code:
n=input()
for i in range(n):
    a=input()
    b=input()
    if len(str(a+b))>80:
        print "overflow"
    else:
        print a+b

Submission status: Accepted

Solution code:
def datasets():
    import sys
    for i in range(int(sys.stdin.readline().strip())):
        s1 = sys.stdin.readline().strip()
        s2 = sys.stdin.readline().strip()
        yield s1, s2

for s1, s2 in datasets():
    r = int(s1)+int(s2)
    if len(s1)>80 or len(s2)>80 or len(str(r))>80:
        print "overflow"
        continue
    print r

Submission status: Accepted

Solution code:
n = long(raw_input())
for i in range(n):
    a = long(raw_input())
    b = long(raw_input())
    c = a + b
    if(len(str(c)) > 80):
        print 'overflow'
    else:
        print c

Submission status: Accepted

Solution code:
for i in range(input()):
	x=input();y=input();
	if len(str(x+y))>80:
		print "overflow"
	else:
		print x+y

Submission status: Accepted

Solution code:
for i in range(input()):
 x=input();y=input();
 if len(str(x+y))>80:
  print "overflow"
 else:
  print x+y

Submission status: Accepted

Solution code:
for i in range(input()):
    x=input();y=input();
    if len(str(x+y))>80:
        print "overflow"
    else:
        print x+y

Submission status: Accepted

Solution code:
n = int(raw_input())
for i in range(n):
	a = int(raw_input())
	b = int(raw_input())
	sum = str(a + b)
	if len(sum) > 80:
		print("overflow")
	else:
		print(sum)

Submission status: Accepted

Solution code:
for i in range(int(raw_input())):
    x = int(raw_input())
    y = int(raw_input())
    s = str(x+y)
    if len(s) > 80:
        print "overflow"
    else :
        print s

Submission status: Accepted

Solution code:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
from sys import stdin

n = int(stdin.readline())
while n:
    result = long(stdin.readline()) + long(stdin.readline())
    if len(str(result)) >= 81:
        print('overflow')
    else:
        print(result)
    n -= 1

Submission status: Accepted

Solution code:
'''
Created on Mar 21, 2013

@author: wukc
'''

from sys import stdin

n=int(stdin.readline())
for i in range(n):
    a,b=[stdin.readline().strip().lstrip("0") for k in range(2)]
    if len(a)>80 or len(b)>80:
        print("overflow")
        continue
    a,b=a.rjust(len(b),'0'),b.rjust(len(a),'0')
    ans=[]
    c=0
    for x,y in zip(a[::-1],b[::-1]):
        t=int(x)+int(y)+c
        c=t//10
        ans+=[t%10]
    ans+=[c]
    ans="".join(map(str,ans[::-1])).lstrip("0")
    if len(ans)>80:
        print("overflow")
        continue
    print(ans.rjust(1,'0'))

Submission status: Accepted

Solution code:
for val in xrange(0,input()):
	a = input()
	b = input()
	c = a+b
	if len(str(a)) <= 80 and len(str(b)) <= 80 and len(str(c)) <= 80: print c
	else: print 'overflow'

Submission status: Accepted

Solution code:
n=int(raw_input())
for i in range(0,n):
  a=int(raw_input())
  b=int(raw_input())
  c=str(a+b)
  if len(c)<=80:
    print c
  else:
    print "overflow"

Submission status: Accepted

Solution code:
n=input()
for i in range(n):
    x=input()
    y=input()
    if 80<len(str(x)) or 80<len(str(y)): print 'overflow'
    else:
        ans=x+y
        if 80<len(str(ans)): print 'overflow'
        else: print x+y

Submission status: Accepted

Solution code:
n = int(raw_input())

for i in range(0,n):
    a = int(raw_input())
    b = int(raw_input())
    ans = str(a+b)

    if len(ans) > 80:
        print 'overflow'
    else:
        print ans

Submission status: Accepted

Solution code:
def isoverflow(s):
    if len(s)>80: return True
    else: return False

n = input()

for i in range(n):
    a = input()
    b = input()

    if isoverflow(str(a)) or isoverflow(str(b)): print "overflow"
    else:
         tmp = a+b
         if isoverflow(str(tmp)): print "overflow"
         else: print tmp

Submission status: Accepted

Solution code:
n = int(raw_input())
for _ in range(n):
    r = int(raw_input()) + int(raw_input())
    if len(str(r)) > 80:
        print 'overflow'
    else:
        print r

Submission status: Accepted

Solution code:
#! /usr/bin/python

num_inputs = int(raw_input())

limit = 100000000000000000000000000000000000000000000000000000000000000000000000000000000

count = 0
while count < num_inputs:
	num1 = int(raw_input())
	num2 = int(raw_input())

	if num1 >= limit or num2 >= limit:
		print('overflow')
	else:
		num = num1 + num2
		if num >= limit:
			print('overflow')
		else:
			print(num)

	count += 1

Submission status: Accepted

Solution code:
for x in range(input()):
    a = input() + input()
    print a if len(str(a)) < 81 else "overflow"

Submission status: Accepted

Solution code:
n = int(raw_input())
for i in range(n):
    a = long(raw_input())
    b = long(raw_input())
    s = a + b
    if s >= pow(10, 80):
        print "overflow"
    else:
        print s

Submission status: Accepted

Solution code:

import math
n = input()
for i in range(n):
  a = input() + input()
  if(len(str(a)) > 80):
    print "overflow"
  else:
    print a

Submission status: Accepted

Solution code:
n = int(raw_input())

for i in range(n):
    a = long(raw_input())
    b = long(raw_input())
    c = a+b
    if len(str(c)) > 80:
        print "overflow"
    else:
        print c

Submission status: Accepted

Solution code:
import sys

n = input()
for i in range(n):
    a = list(reversed(map(int, raw_input())))
    b = list(reversed(map(int, raw_input())))
    if len(a) < len(b):
        a, b = b, a
    for j in range(len(a)):
        if j < len(b):
            a[j] += b[j]
        if a[j] >= 10:
            a[j] -= 10
            if j != len(a) - 1:
                a[j + 1] += 1
            else:
                a.insert(len(a), 1)
    if len(a) > 80:
        print "overflow"
    else:
        for x in reversed(a):
            sys.stdout.write("%d" %x)
        print

Submission status: Accepted

Solution code:
s="overflow"
n=input()
for i in range(n):
  a=raw_input()
  b=raw_input()
  if len(a)>80 or len(b)>80: print s
  else:
    tmp=int(a)+int(b)
    if len(str(tmp))>80: print s
    else: print tmp

Submission status: Accepted

Solution code:
m=10**80
n=input()
for i in range(n):
  s="overflow"
  a=input()
  b=input()
  if a<m and b<m:
    tmp=a+b
    if tmp<m: s=tmp
  print s

Submission status: Accepted

Solution code:
n=input()
for i in range(n):
  a=input()
  b=input()
  c=a+b
  if len(str(c))>80: print "overflow"
  else: print c

Submission status: Accepted

Solution code:
n = int(raw_input())
for i in range(n):
    a = int(raw_input())
    b = int(raw_input())
    if a+b >= 10**80: print 'overflow'
    else: print a+b

Submission status: Accepted

Solution code:
for i in range(int(raw_input())):
    a = str(int(raw_input()) + int(raw_input()))
    print 'overflow' if len(a) > 80 else a

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
  sum = int(input()) + int(input())
  if len(str(sum)) >= 81:
    print 'overflow'
  else:
    print sum

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
  sum = long(input()) + long(input())
  if len(str(sum)) >= 81:
    print 'overflow'
  else:
    print sum

Submission status: Accepted

Solution code:
n = input()
for i in range(n):
    m = input() + input()
    if len(str(m)) >= 81:
        print 'overflow'
    else:
        print m

Submission status: Accepted

Solution code:
n = input()
for _ in xrange(n):
    a, b = input(), input()
    ret = a + b
    overflow = 10 ** 80
    if a + b >= overflow:
        print 'overflow'
    else:
        print ret

Submission status: Accepted

Solution code:
LIMIT = 10 ** 80
n = int(input())
for i in range(n):
    a = int(input())
    b = int(input())
    c = a + b
    if a >= LIMIT or b >= LIMIT or c >= LIMIT:
        print('overflow')
    else:
        print(c)

Submission status: Accepted

Solution code:
import re

def readline():
    return raw_input()

def split8by10(str):
    str = str.rjust(80,'0')
    ss = []
    for s in range(0,len(str),8):
        ss.append(int(str[s:s+8]))
    return ss

def add8by10(a,b):
    c = [0 for i in range(0,10)]
    p = 10**8
    for i in reversed(range(0,10)):
        c[i] += a[i] + b[i]
        if c[i] >= p:
            if i > 0:
                c[i-1] += c[i] // p
            else:
                return None
        c[i] = c[i] % p
    return c

n = int(readline())
for i in range(0,n):
    a = readline()
    b = readline()
    if len(a) > 80 or len(b) > 80:
        print "overflow"
        continue
    a = split8by10(a)
    b = split8by10(b)
    c = add8by10(a,b)
    if c is None:
        print "overflow"
    else:
        print re.sub('^0{,79}',"","".join(map(lambda x:str(x).rjust(8,'0'),c)))

Submission status: Accepted

Solution code:
n=input()
for i in range(0,n):
 a=input()
 b=input()
 s=str(a+b)
 if(len(s)<=80): print a+b
 else: print "overflow"

Submission status: Accepted

Solution code:
def digits(n):
    if n < 10: return 1
    c = 0
    while n > 0:
        c += 1
        n = n // 10

    return c

n = int(input())
for i in range(n):
    u = int(input())
    v = int(input())
    s = u + v
    if (digits(u) > 80 or digits(v) > 80 or digits(s) > 80):
        print("overflow")
    else:
        print(s)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math

n=int(input())

for i in range(n):
    a=int(input())
    b=int(input())
    st=str(a+b)
    if len(st)>80:
        print("overflow")
    else:
        print(st)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n) :
    a = input()
    b = input()
    if len(a) > 80 or len(b) > 80 :
        print("overflow")
    else :
        ans = str(int(a)+int(b))
        if len(ans) > 80 :
            print("overflow")
        else :
            print(int(a) + int(b))

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    num1 = int(input())
    num2 = int(input())
    num3 = num1 + num2
    k = len(str(num3))
    if k > 80:
        print("overflow")
    else:
        print(num3)

Submission status: Accepted

Solution code:
#標準入力
j = int(input())
for _ in range(j):
    a = int(input())
    b = int(input())
    
    #aとbの和を計算
    num = a + b
    
    #桁数を調べ81以上であればoverflowを出力する
    num1 = [c for c in str(num)]
    if len(num1) > 80:num = "overflow"
    else:pass
    print(num)

Submission status: Accepted

Solution code:
N = int(input())
for i in range(N):
    a = int(input())
    b = int(input())
    c = a+b
    if len(str(c)) > 80:
        print("overflow")
    else:
        print(c)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    a = int(input())
    b = int(input())
    s = a + b
    if len(str(s)) > 80 :
        print("overflow")
    else:
        print(s)

Submission status: Accepted

Solution code:
[print((lambda x:x if x<10**80 else "overflow")(int(input())+int(input()))) for i in range(int(input()))]

Submission status: Accepted

Solution code:
for i in range(int(input())):
    a = int(input())
    b = int(input())

    result = a + b
    if len(str(result)) > 80:
        print('overflow')
    else:
        print(result)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())
    for _ in range(N):
        a = input()
        b = input()
        c = str(int(a) + int(b))
        if len(a) > 80 or len(b) > 80 or len(c) > 80:
            print("overflow")
        else:
            print(c)

Submission status: Accepted

Solution code:
while 1:
    try:
        n = int(input())
    except:break

    n1 = 0
    n2 = 0
    for i in range(n):
        n1 = int(input())
        n2 = int(input())
        isOver = False
        ans = n1 + n2
        if len(str(ans)) >= 81 | len(str(n1)) | len(str(n1)) :
            isOver = True
        if isOver:
            print("overflow")
        else:
            print(ans)

Submission status: Accepted

Solution code:
N = int(input())

list = []
for n in range(0, N):
    tmp = []
    for _ in range(0, 2):
        tmp.append(int(input()))
    list.append(tmp)

for a, b in list:
    c = a + b
    if c >= 10 ** 80:
        print('overflow')
    else:
        print(str(c))

Submission status: Accepted

Solution code:
import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop
import copy

BIG_NUM = 2000000000
HUGE_NUM = 99999999999999999
MOD = 1000000007
EPS = 0.000000001
sys.setrecursionlimit(100000)


num_query = int(input())

for _ in range(num_query):
    A = list(map(int,input()))
    B = list(map(int,input()))

    if len(A) > 80 or len(B) > 80:
        print("overflow")
        continue

    if len(B) > len(A): #len(B) <= len(A)にする
        A,B = B,A
    A.reverse()
    B.reverse()

    ANS = deque()
    add = 0

    for digit in range(len(A)):
        if digit >= len(B):
            tmp = add+A[digit]
            add = tmp//10
            ANS.append(tmp%10)
        else:
            tmp = add+B[digit]+A[digit]
            add = tmp//10
            ANS.append(tmp%10)

    if len(A) == 80 and add == 1:
        print("overflow")
    else:
        if add == 1:
            ANS.append(1)

        while len(ANS) > 0:
            print("%d"%(ANS.pop()),end="")
        print()

Submission status: Accepted

Solution code:
n = int(input())
for _ in range(n):
    a = int(input())
    b = int(input())
    c = a + b
    if max(len(str(a)), len(str(b)), len(str(c))) > 80:
        print("overflow")
    else:
        print(c)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    a = int(input())
    b = int(input())
    if len(str(a + b)) > 80:
        print('overflow')
    else:
        print(a+b)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    a = int(input())
    b = int(input())
    if (a + b) // (10 ** 80) > 0:
        print('overflow')
    else:
        print(a + b)

Submission status: Accepted

Solution code:
m = 100000000000000000000000000000000000000000000000000000000000000000000000000000000
n = int(input())
for i in range(n):
    a = int(input())
    b = int(input())
    sum = a + b
    if sum > m or sum == m:
        print("overflow")
    else:
        print(sum)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    s = int(input()) + int(input())
    if len(str(s)) <= 80:
        print(s)
    else:
        print('overflow')

Submission status: Accepted

Solution code:
n =int(input())
for i in range(n):
  a =int(input())
  b=int(input())

  if (a+b)<(10 **80):
    print(a+b)
  else:
    print("overflow")

Submission status: Accepted

Solution code:
n=int(input())
for i in range(n):
    a=input()
    b=input()
    s=int(a)+int(b)
    if len(str(s))>80:
        print("overflow")
    else:
        print(s)

Submission status: Accepted

Solution code:
N=int(input())
for i in range(N):
    a=int(input())
    b=int(input())
    retval=a+b
    if len(str(retval))>80:
        print("overflow")
    else:
        print(retval)

Submission status: Accepted

Solution code:
n=int(input())
for i in range(n):
    a,b=[int(input()) for _ in range(2)]
    print("overflow" if len(str(a+b))>80 else a+b)

Submission status: Accepted

Solution code:
if __name__ == '__main__':

	n = int(input())

	for i in range(n):
		a = int(input())
		b = int(input())

		if len(str(a+b)) > 80:
			print("overflow")
		else:
			print(a+b)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
  a = input()
  b = input()
  if len(a) > 80 or len(b) > 80:
    print("overflow")
  else:
    aa = int(a)
    bb = int(b)
    c = str(aa + bb)
    if len(c) > 80:
      print("overflow")
    else:
      print(c)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
  a = int(input())
  b = int(input())
  if len(str(a+b)) > 80:
    print("overflow")
  else:
    print(a+b)

Submission status: Accepted

Solution code:
while True:
    try:
        N=int(input())
        for i in range(N):
            a=input()
            b=input()
            if len(a)>80 or len(b)>80:
                print("overflow")
            else:
                a=int(a)
                b=int(b)
                s=a+b
                if len(str(s))>80:
                    print("overflow")
                else:
                    print(s)
    except:break