#include <stdio.h>
int ab(int a){
    if(a<0)
        return -a;
    else
        return a;
}

int main(void){
    int n,m,a[101],b[101],i,k,asum=0,bsum=0,differ,ansa=10000,ansb=10000;
    
    while(1){
        scanf("%d %d",&n,&m);
        if(n==0&&m==0)
            break;
        for (i=0; i<100; i++){
            a[i]=0;
            b[i]=0;
        }
        for (i=0; i<n; i++) {
            scanf("%d",&k);
            a[k]=1;
            asum+=k;
        }
        for (i=0; i<m; i++) {
            scanf("%d",&k);
            b[k]=1;
            bsum+=k;
        }
        printf("asum=%d,bsum=%d",asum,bsum);
        differ=asum-bsum;
        if(differ%2){
            printf("-1\n");
            break;
        }
        for(i=0;i<n;i++)
            if(a[i]==1&&b[i-differ/2]==1&&2*i-differ/2<ansa+ansb){
                ansa=i;
                ansb=i-differ/2;
            }
        
        if(ansa==10000)
            printf("-1\n");
        else
            printf("%d %d\n",ansa,ansb);
        ansa=10000;
        ansb=10000;
        asum=0;
        bsum=0;
        
    }
    return 0;
}