#include <stdio.h>
#define N_MAX 100
#define S_MAX 100+1

int main(void)
{
     int n, m, t1, t2, s1[N_MAX], s2[N_MAX], i;
     int x1, x2;
     
     while(1){
	  scanf("%d %d",&n,&m);
	  if(n+m==0) return 0;

	  t1 = t2 = 0;
	  x1 = x2 = S_MAX;
	  
	  for(i=0; i<n; i++) scanf("%d",s1+i), t1+=s1[i];
	  for(i=0; i<m; i++) scanf("%d",s2+i), t2+=s2[i];
	  
	  while(n--)
	       for(i=0; i<m; i++)
		    if(t1 - 2*s1[n] + 2*s2[i] == t2)
			 if(s1[n] + s2[i] < x1 + x2)
			      x1=s1[n], x2=s2[i];

	  if(x1 != S_MAX) printf("%d %d\n",x1,x2);
	  else puts("-1");
     }
}