#include <stdio.h>

#define INF 10000000

int main( void ) {
	int i, j, n, m, num[ 2 ][ 100 ], sum[ 2 ], min[ 2 ], diff;

	for ( ; scanf( "%d %d", &n, &m ), n; printf( min[ 0 ] == INF ? "-1\n" : "%d %d\n", min[ 0 ], min[ 1 ] ) ) {
		sum[ 0 ] = sum[ 1 ] = 0;
		for ( i = n; i--; sum[ 0 ] += num[ 0 ][ i ] )
			scanf( "%d", num[ 0 ] + i );
		for ( i = m; i--; sum[ 1 ] += num[ 1 ][ i ] )
			scanf( "%d", num[ 1 ] + i );

		diff = sum[ 0 ] - sum[ 1 ];
		min[ 0 ] = min[ 1 ] = INF;
		for ( i = n; i--;  )
			for ( j = m; j--;  )
				if ( ( num[ 0 ][ i ] - num[ 1 ][ j ] ) * 2 == diff )
					if ( num[ 0 ][ i ] + num[ 1 ][ j ] < min[ 0 ] + min[ 1 ] ) {
						min[ 0 ] = num[ 0 ][ i ];
						min[ 1 ] = num[ 1 ][ j ];
					}
	}

	return 0;
}