#include <stdio.h>
#include <string.h>

int main(void)
{
	int n, m;
	int s;	
	int card_hanako[101], card_taro[101];
	int sum_hanako, sum_taro;
	int i, j;
	int diff;
	
	while (1){
		scanf("%d%d", &n, &m);
		if (n == 0 && m == 0){
			break;
		}
		
		memset(card_hanako, 0, sizeof(card_hanako));
		memset(card_taro, 0, sizeof(card_taro));
		sum_taro =sum_hanako = 0;
		
		for (i = 0; i < n; i++){
			scanf("%d", &s);
			sum_taro += s;
			card_taro[s]++;
		}
		
		for (i = 0; i < m; i++){
			scanf("%d", &s);
			sum_hanako += s;
			card_hanako[s]++;
		}
		
		diff = sum_taro - sum_hanako;
		
		if (diff % 2 != 0){
			printf("-1\n");
			continue;
		}
		
		diff /= 2;
		
		for (i = 0; i <= 100; i++){
			if (card_taro[i] != 0){
				if (0 <= i - diff && i - diff <= 100){
					if (card_hanako[i - diff] != 0){
						printf("%d %d\n", i, i - diff);
						break;
					}
				}
			}
		}
		if (i > 100){
			printf("-1\n");
		}
	}
	return (0);
}