#include<stdio.h>
int n,m;
int s[101],t[101];
int sum_s,sum_t;
int wa;
int main(void){
    while(1){
        scanf("%d%d",&n,&m);
        if(n+m==0) break;
        wa=0;
        sum_s=sum_t=0;
        int ans_t=0,ans_h=0;
        for(int i=1;i<=n;i++){
            scanf("%d",&s[i]);
            sum_s+=s[i];
        }
        for(int i=1;i<=m;i++){
            scanf("%d",&t[i]);
            sum_t+=t[i];
        }
        for(int i=1;i<=n;i++){
            for(int j=1;j<=m;j++){
                if((sum_s-s[i]+t[j])==(sum_t+s[i]-t[j])){
                    if(wa==0||wa>s[i]+t[j]){
                        wa=s[i]+t[j];
                        ans_t=s[i]; ans_h=t[j];
                    }
                }
            }
        }
        if(ans_t+ans_h==0) printf("-1\n");
        else printf("%d %d\n",ans_t,ans_h);
    }
}

