#include <stdio.h>

int a[101], b[101];
int main(void)
{
    while (1) {
        int n, m, i, j, s, t, resT, resH, minS;
        scanf("%d%d", &n, &m);
        if (n==0 && m==0) break;

        for(s=i=0;i<n;++i) { scanf("%d", a+i); s+=a[i]; }
        for(t=i=0;i<m;++i) { scanf("%d", b+i); t+=b[i]; }

        minS=1<<30;
        resT=resH=-1;
        for(i=0;i<n;++i) {
            for(j=0;j<m;++j) {
                if (s-a[i]+b[j]==t+a[i]-b[j] && minS>a[i]+b[j]) {
                    resT=a[i];
                    resH=b[j];
                    minS=a[i]+b[j];
                }
            }
        }
        if (resT==-1) {
            puts("-1");
        }
        else {
            printf("%d %d\n", resT, resH);
        }
    }
    return 0;
}