#include <stdio.h>

#define INF 10000000

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

	while ( scanf( "%d %d", &n, &m ), n ) {
		sum[ 0 ] = sum[ 1 ] = 0;
		for ( i = 0; i < n; i++ ) {
			scanf( "%d", num[ 0 ] + i );
			sum[ 0 ] += num[ 0 ][ i ];
		}
		for ( i = 0; i < m; i++ ) {
			scanf( "%d", num[ 1 ] + i );
			sum[ 1 ] += num[ 1 ][ i ];
		}

		diff = sum[ 0 ] - sum[ 1 ];
		min[ 0 ] = min[ 1 ] = INF;
		for ( i = 0; i < n; i++ )
			for ( j = 0; 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 ];
					}

		if ( min[ 0 ] == INF )
			puts( "-1" );
		else
			printf( "%d %d\n", min[ 0 ], min[ 1 ] );
	}

	return 0;
}