#include<stdio.h>

int main(void){
    int n=0,m=0;
    int  answert[10000]={0};
    int answerh[10000]={0};
    int taro[101]={0};
    int taroF=0;
    int hanako[101]={0};
    int hanakoF=0;
    int count=0;
    int s=0;
    for(int i=0;i<10000;i++){
        answerh[i]=-1;
        answert[i]=-1;
    }
    while(1){
        scanf("%d %d",&n,&m);
        if(n==0&&m==0) break;
        for(int i=0;i<n;i++){
            scanf("%d",&taro[i]);
            taroF+=taro[i];
        }
        for(int i=0;i<m;i++){
            scanf("%d",&hanako[i]);
            hanakoF+=hanako[i];
        }
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                if(taroF-taro[i]+hanako[j]==hanakoF-hanako[j]+taro[i]){
                    if(answert[count]+answerh[count]>taro[i]+hanako[i]&&s==1){
                        answert[count]=taro[i];
                        answerh[count]=hanako[j];
                    }
                    else if(s==0){
                        answert[count]=taro[i];
                        answerh[count]=hanako[j];
                        s=1;
                    }
                    break;
                }
            }
            
        }
        count++;
        taroF=0;
        hanakoF=0;
        s=0;
    }
    for(int i=0;i<count;i++){
        if(answert[i]==-1&&answerh[i]==-1){
            printf("-1\n");
        }
        else printf("%d %d\n",answert[i],answerh[i]);
    }
    return 0;
}
