Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of *d* meters, and a throw is worth 3 points if the distance is larger than *d* meters, where *d* is some non-negative integer.

Vasya would like the advantage of the points scored by the first team (the points of the first team minus the points of the second team) to be maximum. For that he can mentally choose the value of *d*. Help him to do that.
The first line contains integer *n* (1 ≤ *n* ≤ 2·10<sup class="upper-index">5</sup>) — the number of throws of the first team. Then follow *n* integer numbers — the distances of throws *a*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 2·10<sup class="upper-index">9</sup>). 

Then follows number *m* (1 ≤ *m* ≤ 2·10<sup class="upper-index">5</sup>) — the number of the throws of the second team. Then follow *m* integer numbers — the distances of throws of *b*<sub class="lower-index">*i*</sub> (1 ≤ *b*<sub class="lower-index">*i*</sub> ≤ 2·10<sup class="upper-index">9</sup>).
def binpoisk(a, x):
    l, r = -1, len(a)
    while l + 1 < r:
        m = (l + r) // 2
        if a[m] <= x:
            l = m
        else:
            r = m
    return l

def main():
    n = int(input())
    a = list(map(int, input().split()))
    m = int(input())
    b = list(map(int, input().split()))
    a.sort()
    b.sort()
    res, p1, p2 = 0, 0, 0

    for i in range(n+1):
        if i != n:
            if i != n-1:
                if a[i] != a[i+1]:
                    pnts1 = (i + 1) * 2 + (n-i-1) * 3
                    ind = binpoisk(b, a[i])
                    if ind == -1:
                        pnts2 = m * 3
                    else:
                        pnts2 = (ind+1) * 2 + (m-ind - 1) * 3
                    curr = pnts1 - pnts2
                    if curr > res:
                        res = curr
                        p1, p2 = pnts1, pnts2
                    elif curr == res:
                        if pnts1 > p1:
                            p1 = pnts1
                            p2 = pnts2
            else:
                pnts1 = (i + 1) * 2 + (n - i - 1) * 3
                ind = binpoisk(b, a[i])
                if ind == -1:
                    pnts2 = m * 3
                else:
                    pnts2 = (ind + 1) * 2 + (m - ind - 1) * 3
                curr = pnts1 - pnts2
                if curr > res:
                    res = curr
                    p1, p2 = pnts1, pnts2
                elif curr == res:
                    if pnts1 > p1:
                        p1 = pnts1
                        p2 = pnts2
        else:
            pnts1 = n * 2
            ind = binpoisk(b, a[-1] + 1)
            if ind == -1:
                pnts2 = m * 3
            else:

                pnts2 = (ind + 1) * 2 + (m - ind - 1) * 3
            curr = pnts1 - pnts2
            if curr > res:
                res = curr
                p1, p2 = pnts1, pnts2
            elif curr == res:
                if pnts1 > p1:
                    p1 = pnts1
                    p2 = pnts2

    for i in range(m + 1):
        if i != m:
            if i != m - 1:
                if b[i] != b[i + 1]:
                    pnts2 = (i + 1) * 2 + (m - i - 1) * 3
                    ind = binpoisk(a, b[i])
                    if ind == -1:
                        pnts1 = n * 3
                    else:
                        pnts1 = (ind + 1) * 2 + (n - ind - 1) * 3
                    curr = pnts1 - pnts2
                    if curr > res:
                        res = curr
                        p1, p2 = pnts1, pnts2

                    elif curr == res:
                        if pnts1 > p1:
                            p1 = pnts1
                            p2 = pnts2

            else:
                pnts2 = (i + 1) * 2 + (m - i - 1) * 3
                ind = binpoisk(a, b[i])
                if ind == -1:
                    pnts1 = n * 3
                else:
                    pnts1 = (ind + 1) * 2 + (n - ind - 1) * 3
                curr = pnts1 - pnts2
                if curr > res:
                    res = curr
                    p1, p2 = pnts1, pnts2

                elif curr == res:
                    if pnts1 > p1:
                        p1 = pnts1
                        p2 = pnts2
        else:
            pnts2 = m * 2
            ind = binpoisk(a, b[-1] + 1)
            if ind == -1:
                pnts1 = n * 3
            else:

                pnts1 = (ind + 1) * 2 + (n - ind - 1) * 3
            curr = pnts1 - pnts2
            if curr > res:
                res = curr
                p1, p2 = pnts1, pnts2

            elif curr == res:
                if pnts1 > p1:
                    p1 = pnts1
                    p2 = pnts2
    pnts1 = n * 3
    ind = binpoisk(b, a[0]-1)
    if ind == -1:
        pnts2 = m * 3
    else:
        pnts2 = (ind + 1) * 2 + (m - ind - 1) * 2
    if res < pnts1 - pnts2:
        res = pnts1 - pnts2
        p1, p2 = pnts1, pnts2

    elif pnts1 - pnts2 == res:
        if pnts1 > p1:
            p1 = pnts1
            p2 = pnts2

    pnts2 = m * 3
    ind = binpoisk(a, b[0] - 1)
    if ind == -1:
        pnts1 = n * 3
    else:
        pnts1 = (ind + 1) * 2 + (n - ind - 1) * 2
    if res < pnts1 - pnts2:
        res = pnts1 - pnts2
        p1, p2 = pnts1, pnts2

    elif pnts1 - pnts2 == res:
        if pnts1 > p1:
            p1 = pnts1
            p2 = pnts2
    print(str(p1) +":" +str(p2))

if __name__ == "__main__":
    main()