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

Solution in JAVA (judge verdict: Accepted)

import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		doIt();

	}
	
	public static void doIt(){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 0; i < n; i++){
			String[] str = new String[2];
			str[0] = sc.next();
			str[1] = sc.next();
			if(str[0].length() > 80 || str[1].length() > 80){
				System.out.println("overflow");
				continue;
			}
			int[][] num = new int[2][80];
			for(int j = 0; j < 2; j++){
				//initialize
				for(int k = 0; k < 80; k++){
					num[j][k] = 0;
				}
				int len = str[j].length();
				//System.out.println(len);
				for(int k = 0; k < len; k++){
					char c = str[j].charAt((len - 1) - k);
					num[j][k] = Character.getNumericValue(c);
				}
			}
			//print(num[0]);
			//print(num[1]);
			boolean bUp = false;
			int[] ans = new int[80];
			for(int j = 0; j < 80; j++){
				int tmp = num[0][j] + num[1][j];
				if(bUp){
					tmp++;
					bUp = false;
				}
				if(tmp >= 10){
					tmp = tmp%10;
					bUp = true;
				}
				ans[j] = tmp;
			}
			if(bUp){
				System.out.println("overflow");
				continue;
			}

			//print(ans);
			int start = 79;
			//0は飛ばす
			while(start >= 0 && ans[start] == 0){
				start--;
			}
			if(start == -1){
				System.out.println(0);
			}
			else{
				for(int j = start; j >= 0; j--){
					System.out.print(ans[j]);
				}
				System.out.println("");
			}
			//String2Int[]
		}
	}
	
	public static void print(int[] array){
		int len = array.length;
		for(int i = 0; i < len; i++){
			System.out.print(array[i]);
		}
		System.out.println("");
	}
 
}