#include <stdio.h>

int main(void)
{
    int n, m;

    while(scanf("%d %d", &n, &m), n || m){
        int tarou[128] = {0}, hanako[128] = {0};
        int sumt, sumh;
        int changet, changeh;
        int diff;
        int i, j;

        sumt = 0;
        for (i = 0; i < n; i++){
            int t;
            scanf("%d", &t);
            sumt += t;
            tarou[t] = 1;
        }
        sumh = 0;
        for (i = 0; i < m; i++){
            int t;
            scanf("%d", &t);
            sumh += t;
            hanako[t] = 1;
        }

        changet = changeh = 128;
        for (i = 0; i <= 100; i++){
            for (j = 0; j <= 100; j++){
                if (!tarou[i] || !hanako[j]) continue;
                if (sumt - i + j == sumh + i - j && i + j < changet + changeh){
                    changet = i;
                    changeh = j;
                }
            }
        }
        if (changet != 128 && changeh != 128) printf("%d %d\n", changet, changeh);
        else puts("-1");
    }

    return 0;
}