#include <stdio.h>
#include <stdlib.h>
  
#define NMAX 100
  
int bs (int [], int, int);
  
int compar (const void *a, const void *b) {
  return *(int *)a- *(int *)b;
}
  
int main(void)
{
  while(1)
  {
    int i,n,m,A[NMAX],B[NMAX],Asum=0,Bsum=0,S,D,a,b,k;
    scanf("%d%d",&n,&m);
    if(n==0 && m==0) break;
    for(i=0;i<=n-1;i++)
    {
        scanf("%d",&A[i]);
		Asum+=A[i];
    }
    for(i=0;i<=m-1;i++)
	{
		scanf("%d",&B[i]);
		Bsum+=B[i];
	}
	qsort(B,m,sizeof(int),compar);
	S=1000;
	k=-1;
	for(i=0;i<=n-1;i++)
	{
		D=Bsum-Asum+2*A[i];
		if(D%2==0)
		{
			D=D/2;
			if(bs(B,m,D)!=-1 && S>A[i]+bs(B,m,D))
			{
				S=A[i]+bs(B,m,D);
				a=A[i];
				b=bs(B,m,D);
				k=0;
			}
		}
	}
	if(k==0)
	{
	    printf("%d %d\n",a,b);
	}
	else
	{
		printf("-1\n");
	}
  }
  return 0;
}
  
 int bs (int D[], int n, int c) 
 {
    int j,k,l;
    j=0;
    k=n-1;
    while(1)
    {
        if(j<=k)
        {
            l=(j+k)/2;
            if(D[l] > c)
            {
                k=l-1;
            }
            else if(D[l] < c)
            {
                j=l+1;
            }
            else
            {
                return D[l];
            }
        }
        else
        {
            return -1;
        }
    }
}