#include <cstdio>

int myAbs(int num) { return (num > 0) ? num : -num ; }

int countNumberLength(char *data) {
	for (int i = 0;; i++) {
		if (data[i] == '\0')
			return i;
	}
	return 0;
}

void moveNumber(char *data, int diff, int length) {
	int idx = length;
	for (int i = 0; i < length+1; i++) {
		data[idx-i+diff] = data[idx-i];
	}
	for (int i = 0; i < diff; i++) {
		data[i] = '0';
	}
}

int chr2int(char chr) {
	int ret;
	switch (chr) {
	case '1':
		ret = 1;
		break;
	case '2':
		ret = 2;
		break;
	case '3':
		ret = 3;
		break;
	case '4':
		ret = 4;
		break;
	case '5':
		ret = 5;
		break;
	case '6':
		ret = 6;
		break;
	case '7':
		ret = 7;
		break;
	case '8':
		ret = 8;
		break;
	case '9':
		ret = 9;
		break;
	case '0':
		ret = 0;
		break;
	case 'X':
		ret = 10;
		break;
	
	}
	return ret;
}

const char int2chr[11] = {
	'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'X'
};

void makeSumNumber(char *left, char *right, char *sum, int length) {
	sum[length] = '\0';
	for (int i = length-1; i !=-1; i--) {
		int t_sum = chr2int(left[i]) + chr2int(right[i]);
		if (t_sum >= 10) {
			if (i != 0) {
				left[i-1] = int2chr[chr2int(left[i-1])+1];
				t_sum %= 10;
			}
		}
		sum[i] = int2chr[t_sum];
	}
}

int main(int argc, char *argv[]) {
	using namespace std;
	
	int dataN;
	fscanf(stdin, "%d", &dataN);
	
	for (int i = 0; i < dataN; i++) {
		char tmp1[100], tmp2[100], sum[100];
		int cnt1, cnt2, diff, longer;
		fscanf(stdin, "%s", tmp1);
		fscanf(stdin, "%s", tmp2);
		cnt1 = countNumberLength(tmp1);
		cnt2 = countNumberLength(tmp2);
		diff = myAbs(cnt1 - cnt2);
		
		// is Overflow
		if (cnt1 > 80 || cnt2 > 80) {
			puts("overflow");
		}
		else {
			printf("%d:%s\n", cnt1, tmp1);
			printf("%d:%s\n", cnt2, tmp2);
			if (cnt1 > cnt2) {
				longer = cnt1;
				// set tmp
				moveNumber(tmp1, 1, cnt1+1);
				moveNumber(tmp2, diff+1, cnt2+1);
				// get sum
				makeSumNumber(tmp1, tmp2, sum, cnt1+1);
			}
			else if (cnt1 < cnt2) {
				longer = cnt2;
				// set tmp
				moveNumber(tmp2, 1, cnt2+1);
				moveNumber(tmp1, diff+1, cnt1+1);
				// get sum
				makeSumNumber(tmp1, tmp2, sum, cnt2+1);
			}
			else {
				longer = cnt1;
				// set tmp
				moveNumber(tmp1, 1, cnt1+1);
				moveNumber(tmp2, 1, cnt2+1);
				// get sum
				makeSumNumber(tmp1, tmp2, sum, cnt1+1);
			}
			// after calc
			if (sum[0] == '0') {
				for (int i = 1; i < longer+2; i++) {
					sum[i-1] = sum[i];
				}
			}
			else {
				if (cnt1 >= 80 || cnt2 >= 80) {
					puts("overflow");
					continue;
				}
			}
			
			printf("%s\n", sum);
		}
	}
	return 0;
}