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_datasets = int(input())

for i in range(num_datasets):
    n = input().strip()
    m = input().strip()
    first_num_str = ""
    second_num_str = ""
    if len(n) > len(m):
        first_num_str = n
        second_num_str = m
    else:
        first_num_str = m
        second_num_str = n
    total = ""
    carry = 0
    first_int = 0
    second_int = 0
    first_last_index = len(first_num_str)-1
    second_last_index = len(second_num_str)-1
    for i in range(len(first_num_str)):
        first_int = int(first_num_str[first_last_index-i])
        if i < len(second_num_str):
            second_int = int(second_num_str[second_last_index-i])
        else:
            second_int = 0
        added = (first_int + second_int + carry) % 10
        carry = (first_int + second_int + carry) // 10
        total = str(added) + total
    if carry > 0:
        total = str(carry) + total
    if len(total) > 80:
        print("overflow")
    else:
        print(total)

Submission status: Accepted

Solution code:
import math
n=int(input())
s=[int(input()) for _ in range(n*2)]
for i in range(n):
  a=s[i*2]+s[i*2+1]
  st=str(a)
  if len(st)>80:
    print("overflow")
  else:
    print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# N行の入力（Nが最初の行）
n = int(input())
for _ in range(n):
    m1, m2 = int(input()), int(input())
    print(m1 + m2 if len(str(m1 + m2)) <= 80 else 'overflow')

Submission status: Accepted

Solution code:
n = int(input())
for _ 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:
N = int(input())
num = [sum([int(input()) for _ in range(2)]) for _ in range(N)]

for n in num:
    if n < 10**80:
        print(n)
    else:
        print('overflow')

Submission status: Accepted

Solution code:
# 12,432 -> 012,432
def align_digits(a, b):
    la, lb = len(a), len(b)
    if la < lb:
        a = a.zfill(lb)
    elif lb < la:
        b = b.zfill(la)
    return a, b


def add(a, b):
    a, b = align_digits(a, b)
    zipped = list(zip(a[::-1], b[::-1]))
    carry = 0
    result = []
    for i, z in enumerate(zipped):
        a, b = z
        s = int(a) + int(b) + carry
        carry = int(s / 10)
        if i == len(zipped) - 1:
            result.append(str(s))
        else:
            result.append(str(s % 10))
    ans = ''.join(result[::-1])
    if len(ans) > 80:
        return 'overflow'
    return ans


if __name__ == '__main__':
    n_input = int(input())
    inputs = []
    for i in range(n_input):
        inputs.append((input(), input()))
    for a, b in inputs:
        print(add(a, b))

Submission status: Accepted

Solution code:
n = int(input())
for _ in range(n):
    s1 = int(input())
    s2 = int(input())
    s3 = s1+s2
    if len(str(s3)) > 80:
        print("overflow")
    else:
        print(s3)

Submission status: Accepted

Solution code:
def run():
    N = int(input())
    for _ in range(N):
        x = int(input())
        y = int(input())
        if 80 < len(str(x)) or 80 < len(str(y)) or 80 < len(str(x+y)):
            print('overflow')
        else:
            print(x+y)

if __name__ == '__main__':
    run()

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:
for i in range(int(input())):
    s=int(input())+int(input())
    if s>=int("1"+"0"*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())
    if (a+b) < (10**80):
        print(a+b)
    else:
        print("overflow")

Submission status: Accepted

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

import math

BIG_NUM = 100000000000000000000000000000000000000000000000000000000000000000000000000000000


def main():
    n = int(input())
    for _ in range(n):
        a = int(input())
        b = int(input())
        if a >= BIG_NUM  or b >= BIG_NUM or a + b >= BIG_NUM:
            print("overflow")
        else:
            print(a+b)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# National Budget
md = 80
for _ in range(int(input())):
    a,b = int(input()),int(input())
    ab = a + b
    if a >= pow(10,md) or b >= pow(10,md) or ab >= pow(10,md):
        print('overflow')
    else:
        print(a+b)

Submission status: Runtime Error

Solution code:
import sys

if __name__=='__main__':
  lines = [int(x.strip()) for x in sys.stdin.readlines()]
  n = lines[0]
  for i in range(n):
    # a, b  = int(lines[i+1]), int(lines[i+2])
    a, b  = lines[2*i+1], lines[2*i+2]
    print a+b

Submission status: Runtime Error

Solution code:
import sys

if __name__=='__main__':
  lines = [int(x.strip()) for x in sys.stdin.readlines()]
  n = lines[0]
  for i in range(n):
    # a, b  = int(lines[i+1]), int(lines[i+2])
    a, b  = lines[2*i+1], lines[2*i+2]
    if len(str(a+b)) > 80:
      print 'overflow'
    else:
      print a+b

Submission status: Runtime Error

Solution code:
#! -*- coding: utf-8-unix -*-
import sys

if __name__=='__main__':
  lines = [int(x.strip()) for x in sys.stdin.readlines()]
  n = lines[0]
  for i in range(n):
    # a, b  = int(lines[i+1]), int(lines[i+2])
    a, b  = lines[2*i+1], lines[2*i+2]
    if len(str(a+b)) > 80:
      print 'overflow'
    else:
      print a+b

Submission status: Runtime Error

Solution code:
import sys

if __name__=='__main__':
  lines = [int(x.strip()) for x in sys.stdin.readlines()]
  n = lines[0]
for i in xrange(n):
  # a, b  = int(lines[i+1]), int(lines[i+2])
  a, b  = lines[2*i+1], lines[2*i+2]
  if len(str(a+b)) > 80:
    print 'overflow'
  else:
    print a+b

Submission status: Runtime Error

Solution code:
import sys

if __name__=='__main__':
  lines = [int(x.strip()) for x in sys.stdin.readlines() if x != '']
  n = lines[0]
for i in xrange(n):
  # a, b  = int(lines[i+1]), int(lines[i+2])
  a, b  = lines[2*i+1], lines[2*i+2]
  if len(str(a+b)) > 80:
    print 'overflow'
  else:
    print a+b

Submission status: Runtime Error

Solution code:
import sys

if __name__=='__main__':
  lines = [int(x.strip()) for x in sys.stdin.readlines() if x != '']
  n = lines[0]
for i in xrange(n):
  a, b  = lines[2*i+1], lines[2*i+2]
  if len(str(a+b)) > 80:
    print 'overflow'
  else:
    print a+b

Submission status: Runtime Error

Solution code:
import math

c  = input();

for var in range(0, int(c)) :
	n1 = input();
	n2 = input();
	sum = int(n1) + int(n2);

	if int(math.log10(sum)) + 1 > 80 :
		print("overflow");
	else :
		print(sum);

Submission status: Runtime Error

Solution code:
import math

c  = raw_input();

for var in range(0, int(c)) :
	n1 = raw_input();
	n2 = raw_input();
	sum = int(n1) + int(n2);

	if int(math.log10(sum)) + 1 > 80 :
		print("overflow");
	else :
		print(sum);

Submission status: Runtime Error

Solution code:
import math

c  = raw_input()

for var in range(0, int(c)) :
	n1 = raw_input()
	n2 = raw_input()
	sum = int(n1) + int(n2)

	if int(math.log10(sum)) + 1 > 80 :
		print("overflow")
	else :
		print(sum)

Submission status: Runtime Error

Solution code:
import math
c  = raw_input()
for var in range(0, int(c)) :
	n1 = raw_input();
	n2 = raw_input();
	sum = int(n1) + int(n2)
	if int(math.log10(sum)) + 1 > 80 :
		print("overflow")
	else :
		print(sum)

Submission status: Runtime Error

Solution code:
import math
c  = raw_input();
for var in range(0, int(c)) :
	n1 = raw_input();
	n2 = raw_input();
	sum = int(n1) + int(n2)
	if int(math.log10(sum)) + 1 > 80 :
		print("overflow")
	else :
		print(sum)
exit(0)

Submission status: Runtime Error

Solution code:
import math
c  = raw_input();
for var in range(0, int(c)) :
	n1 = raw_input();
	n2 = raw_input();
	sum = int(n1) + int(n2)
	if int(math.log10(sum)) + 1 > 80 :
		print("overflow")
	else :
		print(sum)
exit()

Submission status: Runtime Error

Solution code:
import math
n = input();
for var in range(0, int(n)) :
	c1 = input();
	c2 = input();
	sum = int(c1) + int(c2);
	if(math.log10(sum) + 1 > 80) :
		print("overflow");
	else :
		print(sum);

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


import sys
import math

def dig(n):
  return int(math.log10(n))

num = input()
count = 0
for i in range(num):
  num1 = []
  s = input()
  t = input()
  if dig(s) > 80 or dig(t) > 80 or dig(s+t) > 80 :
    print "overflow"
  else:
    print s+t

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


import sys

num = input()
for i in range(num):
  num1 = []
  s = input()
  t = input()
  u = s+u
  if len(str(u)) > 80 :
    print "overflow"
  else:
    print u

Submission status: Runtime Error

Solution code:
import math

n = int(raw_input())

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

    if math.log10(a) > 79 or math.log10(b) > 79:
        print 'overflow'
    else:
        c = a + b
        if math.log10(c) > 79:
            print 'overflow'
        print c

Submission status: Runtime Error

Solution code:
import math

n = int(raw_input())

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

    if math.log10(a) > 79 or math.log10(b) > 79:
        print 'overflow'
    else:
        c = a + b
        if math.log10(c) > 79:
            print 'overflow'
        else:
            print c

Submission status: Runtime Error

Solution code:
import math
import sys

for cnt, line in enumerate(sys.stdin):

    if cnt == 0:continue

    if cnt % 2 == 1: 
        a = int(line)
        continue
    else:
        b = int(line)

    if math.log10(a) > 79 or math.log10(b) > 79:
        print 'overflow'
    else:
        c = a + b
        if math.log10(c) > 79:
            print 'overflow'
        else:
            print c

Submission status: Runtime Error

Solution code:
n = int(input())
for _ in range(n):
    a = sum([int(input()) for _ in range(n)])
    print(a if a < 10**80 else 'overflow')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
for x in range(input()):
    x=raw_input()
    x=x[::-1]
    y=raw_input()
    y=y[::-1]
    z=[0]*81
    for i in xrange(len(x)):
        z[i]=int(x[i])
    for j in xrange(len(y)):
        z[j]=z[j]+int(y[j])
    for k in xrange(max(len(x),len(y))):
        sum=z[k]
        z[k]=sum%10
        z[k+1]+=sum/10
    z.reverse()
    for j in xrange(len(z)):
        if z[0]==0:
            z.pop(0)
        else:
            break
    print ''.join(map(str,z))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()

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

Submission status: Runtime Error

Solution code:
n = input()

for i in range(n):
    a = input(),
    b = input()
    c = a + b
    if len(a) > 80 or len(b) > 80 or len(c) > 80 :
        print 'overflow'
    else:
        print a + b

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
#-*- coding:utf-8 -*-

import sys
import math

n = int(input())
anss = []

for _ in range(n):
    x = int(input())
    y = int(input())
    anss.append(x+y)
    if int(math.log10(x)+1) > 80:
        print("overflow")
    elif int(math.log10(y)+1) > 80:
        print("overflow")
    elif int(math.log10(x+y)+1) > 80:
        print("overflow")

for data in anss:
    print(data)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
#-*- coding:utf-8 -*-

import sys
import math

n = int(input())
anss = []

for _ in range(n):
    x = int(input())
    y = int(input())
    if int(math.log10(x)+1) > 80:
        print("overflow")
    elif int(math.log10(y)+1) > 80:
        print("overflow")
    elif int(math.log10(x+y)+1) > 80:
        print("overflow")
    else:
        anss.append(x+y)

for data in anss:
    print(data)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
#-*- coding:utf-8 -*-

import sys
import math

def digit(x):
    d = 0
    while x >= 1:
        x /= 10
        d += 1

    return d

n = int(input())
anss = []

for _ in range(n):
    x = int(input())
    y = int(input())
    if int(digit(x)) > 80:
        print("overflow")
    elif int(digit(y)) > 80:
        print("overflow")
    elif int(digit(x+y)) > 80:
        print("overflow")
    else:
        anss.append(x+y)

for data in anss:
    print(data)

Submission status: Runtime Error

Solution code:
import math

def main() :
    n = int(input())
    for i in range(0, n) :
        a = int(input())
        b = int(input())
        if (math.log10(a + b) + 1 > 80) :
            print("overflow")
            continue
        print(a + b)

main()

Submission status: Runtime Error

Solution code:
import math

n = int(input())
for i in range(0, n) :
    a = int(input())
    b = int(input())
    if (math.log10(a + b) + 1 > 80) :
        print("overflow")
        continue
    print(a + b)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
n = int(raw_input());
for i in range(0, n):
    a = long(raw_input());
    b = long(raw_input());
    if math.log10(a + b) > 80:
        print "overflow"
    else:
        print a + b;

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
n = int(raw_input());
for i in range(0, n):
    a = int(raw_input());
    b = int(raw_input());
    if math.log10(a + b) > 80:
        print "overflow"
    else:
        print a + b;

Submission status: Runtime Error

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

def main():
    for i in range(int(input())):
        a=int(input())+int(input())
        if la>=10**80:
            print("overflow")
        print(a)
            
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(raw_input())
while n > 0:
  a = int(raw_input())
  b = int(raw_input())
  if len(str(a+b))>80:
    print('overflow')
  else:
    print(a+b)
  n -= 1

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

n = int(input())
for i in range(n):
    for i in range(2):
        x = int(input())
        y = int(input())
        result = x * y
        print(result) if math.log10(result) + 1 < 10 ** 80 else print("overflow")

Submission status: Runtime Error

Solution code:
import math

n = int(input())
for i in range(n):
    for i in range(2):
        x = int(input())
        y = int(input())
        result = x + y
        print(result) if math.log10(result) + 1 < 10 ** 80 else print("overflow")

Submission status: Runtime Error

Solution code:
import math

n = int(input())
for i in range(n):
    for i in range(2):
        x = int(input())
        y = int(input())
        result = x + y
        print(result) if math.log10(result) + 1 < 80 else print("overflow")

Submission status: Runtime Error

Solution code:
import math

n = int(input())
for i in range(n):
    x = int(input())
    y = int(input())
    result = x + y
    if math.log10(result) + 1 < 80:
        print(result)
    else:
        print("overflow")

Submission status: Runtime Error

Solution code:
import math

n = int(input())
for i in range(n):
    x = int(input())
    y = int(input())
    result = x + y
    if math.log10(result) + 1 < 81:
        print(result)
    else:
        print("overflow")

Submission status: Runtime Error

Solution code:
n=int(input())
for _ in range(n):
	s=int(input())+int(input())
	print('overflow' iflen(str(s))>80 else s)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
for i in range(N):
    a = int(input())
    b = int(input())
    if math.log10(a) > 79 or math.log10(b) > 79 or math.log10(a + b) > 79:
        print("overflow")
    else:
        print(a + b)

Submission status: Runtime Error

Solution code:
import sys
import itertools

dataset_num = int(input())

class Overflow(Exception):
    pass

for _ in range(dataset_num):
    try:
        k1 = input()
        k2 = input()
        k1_val = [0] * 80
        k2_val = [0] * 80

        if len(k1) > 80 or len(k2) > 80:
            raise Overflow()
        
        for i, x in enumerate(reversed(k1)):
            k1_val[i] = int(x)

        for i, x in enumerate(reversed(k2)):
            k2_val[i] = int(x)
        
        res = [0] * 80
        for i in range(0, 80):
            res[i] += k1_val[i] + k2_val[i]
            if res[i] >= 10:
                res[i+1] += 1
                res[i] -= 10
        sumstr = "".join([str(x) for x in itertools.dropwhile(lambda x: x == 0, reversed(res))])
        if len(sumstr) > 80:
            raise Overflow()

        print(sumstr)
    except Overflow:
        print("overflow")

Submission status: Runtime Error

Solution code:
import math
for i in range(int(input())):
    a = int(input())
    b = int(input())
    if int(math.log10(a+b) + 1) > 80:
        print("overflow")
    else:
        print(a+b)

Submission status: Runtime Error

Solution code:
import math

n = int(input())

for i in range(0, n):
    a = int(input())
    b = int(input())
    if math.log10(a + b) + 1 > 80:
        print("overflow")
    else :
        print(a + b)

Submission status: Runtime Error

Solution code:
import math

n = int(input())

for i in range(0, n):
    a = int(input())
    b = int(input())
    if int(math.log10(a + b)) + 1 > 80:
        print("overflow")
    else :
        print(a + b)

Submission status: Runtime Error

Solution code:
import math

n = int(input())

for i in range(0, n) :
    a = int(input())
    b = int(input())
    if math.log10(a + b) + 1 > 80 :
        print("overflow")
    elif math.log10(a) + 1 > 80 :
        print("overflow")
    elif math.log10(b) + 1 > 80 :
        print("overflow")
    else :
        print(a + b)

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

n = input()
for i in xrange(n):
    result = long(raw_input()) + long(raw_input())
    if int(math.log10(result)) + 1 >80: print "overflow"
    else: print result

Submission status: Runtime Error

Solution code:
import math

n = input()
for i in xrange(n):
    result = long(raw_input()) + long(raw_input())
    if math.log10(result) + 1 >80: print "overflow"
    else: print result

Submission status: Runtime Error

Solution code:
for i in xrange(input()):
    a, b = map(int, raw_input().split())
    print a+b if len(str(a+b)) <= 80 else 'overflow'

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())

for _ in range(N):
    a = int(input())
    b = int(input())
    s = str(a + b)
    limit = '1' + '0'*79
    if len(s) <= limit:
        print(s)
    else:
        print('overflow')

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:
n=input()
 for x in n:
	a=input()
	b=input()
	print(a+b)

Submission status: Runtime Error

Solution code:
n=input()
while (i<n):
	a=input()
	b=input()
	print(a+b)
	i++

Submission status: Runtime Error

Solution code:
n=input()
while (i<n):
	a=input()
	b=input()
        a=a+b
	print(a)
	i++

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
for i in range(int(input()))
    try:
        a = [sum(int(j)) for j in input().split()]
    except:
        print("overflow")
    else:
        print(a)

Submission status: Runtime Error

Solution code:
for i in range(int(input())):
    try:
        a = sum([int(j) for j in input()split()]
    except:
        print("overflow")
    else:
        print(a)

Submission status: Runtime Error

Solution code:
for i in range(int(input())):
    try:
        a = sum([int(j) for j in input().split()]
    except:
        print("overflow")
    else:
        print(a)

Submission status: Runtime Error

Solution code:
for i in range(int(input())):
    try:
        a = sum([int(j) for j in input().split()])
    if a > 2147483647:
        print("overflow")
    else:
        print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

n = int(input())
for i in range(n):
    x = int(input())
    y = int(input())
    if int(math.log10(x + y) + 1) > 80:
        print("overflow")
    else:
        print(x + y)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
for i in range(n):
    x = int(input())
    y = int(input())
    if int(math.log10(x + y) + 1) > 80:
        print("overflow")
    else:
        print(x + y)

Submission status: Runtime Error

Solution code:
"""
# Too slow
def add2(a, b):
    a, b = align_digit(a, b)
    zipped = zip(a[::-1], b[::-1])
    carry = 0
    result = []
    for a, b in zipped:
        s = int(a) + int(b) + carry
        carry = int(s / 10)
        result.append(str(s % 10))
    if result[-1] == '0':
        result[-1] = str(carry)
    print(''.join(result[::-1]))
"""


def align_digit(a, b):
    la, lb = len(a), len(b)
    if la < lb:
        a = a.zfill(lb)
    elif lb < la:
        b = b.zfill(la)
    return a, b


def split_to_ints(s, n=10):
    length = len(s)
    return [int(s[i-n:i]) for i in range(length, 0, -n)]


def add(a, b, n=10):
    a, b = align_digit(a, b)
    print(a, b)
    ints_a = split_to_ints(a, n)
    ints_b = split_to_ints(b, n)
    carry = 0
    result = []

    zipped = list(zip(ints_a, ints_b))[::-1]
    print(zipped)
    for i, (int_a, int_b) in enumerate(zipped):
        s = int_a + int_b + carry
        carry = int(s / (10 ** n))
        if i != len(zipped) - 1:
            result.append(str(s % (10 ** (n - 1))).zfill(n))
        else:
            result.append(str(s))

    print(result)
    ret = str(int(''.join(reversed(result))))
    if len(ret) > 80:
        return 'overflow'
    return ret


if __name__ == '__main__':
    n_input = int(input())
    for i in range(n_input):
        a, b = input(), input()
        print(add(a, b))

Submission status: Runtime Error

Solution code:
while True:
  count = int(input())
  for a in range(count):
    q,w =int(input()),int(input())
    t=q+w
    if t >10**80:
      print "overflow"
    else:
      print t

Submission status: Runtime Error

Solution code:
line_num = int(raw_input())
for n in range(line_num):
	a = raw_input()
	b = raw_input()
	ov = 0
	if len(a) > 80 or len(b) > 80:
		print 'overflow'
		ov = 1
	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:
		if ov < 1:
			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)
		print ''.join(map(str,list_sum))

Submission status: Runtime Error

Solution code:
import sys
ds = int(raw_input())
list =[int(x) for x in sys.stdin]
print list
for i in xrange(ds):
    print str(list[i*2]+list[i*2+1])

Submission status: Runtime Error

Solution code:
import sys
ds = int(raw_input())
list =[long(x) for x in sys.stdin]
print list
for i in xrange(ds):
    print str(list[i*2]+list[i*2+1])

Submission status: Runtime Error

Solution code:
import sys
ds = int(raw_input())
list =[int(x) for x in sys.stdin.readlines()]
print list
for i in xrange(ds):
    print str(list[i*2]+list[i*2+1])

Submission status: Runtime Error

Solution code:
import sys
ds = int(raw_input())
list =[long(x.strip()) for x in sys.stdin.readlines()]
print list
for i in xrange(ds):
    sum = str(list[i*2]+list[i*2+1])
    if len(sum) > 80:
        print "overflow"
    else:
        print sum

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys


def to_list(n):
    l = list(n)
    ls = len(l)
    l = ['0'] * (80 - ls) + l
    l.reverse()
    return l


def add(a, b, c):
    x = a + b + c
    if x >= 10:
        y = x / 10
        x = x % 10
    else:
        y = 0
    return (x, y)


def str_add(a, b):
    s = a[0]
    k = a[1]
    i = int(b[0])
    j = int(b[1])
    (x, y) = add(i, j, k)
    return (s + str(x), y)


def str_format(s):
    l = list(s)
    l.reverse()
    s = ''.join(l)
    return s.lstrip('0')


def solv(a, b):
    la = to_list(a)
    lb = to_list(b)
    z = map((lambda x, y: (x, y)), la, lb)
    r = reduce((lambda a, b: str_add(a, b)), z, ('', 0))
    if r[1] > 0:
        return "overflow"
    else:
        result = str_format(r[0])
        return result


def make_pair(lis):
    ps = []
    while lis:
        a = lis.pop(0).rstrip("\r\n")
        b = lis.pop(0).rstrip("\r\n")
        ps.append((a, b))
    return ps



#input_file = open(sys.argv[1], "r")

#lines = input_file.readlines()
lines = sys.stdin.readlines()
lines.pop(0)
pairs = make_pair(lines)
for p in pairs:
    result = solv(p[0], p[1])
    print result

Submission status: Runtime Error

Solution code:
#
# AIZU ONLINE JUDGE: National Budget
# cf. http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0015&lang=jp
#

import sys


def to_list(n):
    l = list(n)
    ls = len(l)
    l = ['0'] * (80 - ls) + l
    l.reverse()
    return l


def add(a, b, c):
    x = a + b + c
    if x >= 10:
        y = x / 10
        x = x % 10
    else:
        y = 0
    return (x, y)


def str_add(a, b):
    s = a[0]
    k = a[1]
    i = int(b[0])
    j = int(b[1])
    (x, y) = add(i, j, k)
    return (s + str(x), y)


def str_format(s):
    l = list(s)
    l.reverse()
    s = ''.join(l)
    return s.lstrip('0')


def solv(a, b):
    la = to_list(a)
    lb = to_list(b)
    z = map((lambda x, y: (x, y)), la, lb)
    r = reduce((lambda a, b: str_add(a, b)), z, ('', 0))
    if r[1] > 0:
        return "overflow"
    else:
        result = str_format(r[0])
        return result


def make_pair(lis):
    ps = []
    while lis:
        a = lis.pop(0).rstrip("\r\n")
        b = lis.pop(0).rstrip("\r\n")
        ps.append((a, b))
    return ps



lines = sys.stdin.readlines()
lines.pop(0)
pairs = make_pair(lines)
for p in pairs:
    result = solv(p[0], p[1])
    print result

Submission status: Runtime Error

Solution code:
while True:
    a=raw_input()
    b=raw_input()
    if int((a + b) / 10**80):
        print "overflow"
    else:
        print a + b

Submission status: Runtime Error

Solution code:
a=raw_input()
b=raw_input()
total=a+b
if int(total/10**80):
    print "overflow"
else:
    print total