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.


-----Input-----

The first line contains integer n (1 ≤ n ≤ 2·10^5) — the number of throws of the first team. Then follow n integer numbers — the distances of throws a_{i} (1 ≤ a_{i} ≤ 2·10^9). 

Then follows number m (1 ≤ m ≤ 2·10^5) — the number of the throws of the second team. Then follow m integer numbers — the distances of throws of b_{i} (1 ≤ b_{i} ≤ 2·10^9).


-----Output-----

Print two numbers in the format a:b — the score that is possible considering the problem conditions where the result of subtraction a - b is maximum. If there are several such scores, find the one in which number a is maximum.


-----Examples-----
Input
3
1 2 3
2
5 6

Output
9:6

Input
5
6 7 8 9 10
5
1 2 3 4 5

Output
15:10

Difficulty: interview

Starter code:

Solutions:
"""
Codeforces Contest 281 Div 2 Problem C

Author  : chaotic_iak
Language: Python 3.3.4
"""

def main():
    n, = read()
    a = read()
    res = [(i,0) for i in a]
    m, = read()
    b = read()
    res.extend((i,1) for i in b)
    res.sort()
    mxa = 3*n
    mnb = 3*m
    cra = 3*n
    crb = 3*m
    for _,i in res:
        if i:
            crb -= 1
            if cra-crb > mxa-mnb:
                mxa = cra
                mnb = crb
        else:
            cra -= 1
    print(str(mxa) + ":" + str(mnb))

################################### NON-SOLUTION STUFF BELOW

def read(mode=2):
    # 0: String
    # 1: List of strings
    # 2: List of integers
    inputs = input().strip()
    if mode == 0: return inputs
    if mode == 1: return inputs.split()
    if mode == 2: return list(map(int, inputs.split()))

def write(s="\n"):
    if s is None: s = ""
    if isinstance(s, list): s = " ".join(map(str, s))
    s = str(s)
    print(s, end="")

write(main())

__author__ = 'PrimuS'

from bisect import bisect_left

n = int(input())
t1 = [int(x) for x in input().split()]
m = int(input())
t2 = [int(x) for x in input().split()]

t1.sort()
t2.sort()

best = [3 * n, 3 * m]

for i in range(n):
    a = 2 * i + 3 * (n - i)
    u = bisect_left(t2, t1[i])
    b = u * 2 + 3 * (m - u)
    if a - b > best[0] - best[1]:
        best[0] = a
        best[1] = b


if 2 * n - 2 * m > best[0] - best[1]:
    best = [2 * n, 2 * m]

print(best[0], ":", best[1], sep='')


n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))

a = sorted(a)
b = sorted(b)

import bisect

mx = -5555555555555
aa = -5555555555555555
bb = -5555555555555555

cands = list(a + b)
cands.append(0)
cands.append(3000000009)

for v in cands:
    q1 = len(a) - bisect.bisect_left(a, v)
    q2 = len(b) - bisect.bisect_left(b, v)
    c1 = q1 * 3 + 2 * (len(a) - q1)
    c2 = q2 * 3 + 2 * (len(b) - q2)
    if (c1 - c2 > mx) or (c1 - c2 == mx and c1 > aa):
        mx = c1 - c2
        aa = c1
        bb = c2

print(str(aa)+':'+str(bb))

        

        




n = int(input())
a = [int(s) for s in input().split()]
m = int(input())
b = [int(s) for s in input().split()]

INF = 3000000000
a.sort()
b.sort()

a.append(INF)
b.append(INF)
i = 0
j = 0

bestd = 0
bestadv = (n-m)*3
besta = 3*n
bestb = 3*m
cura = 3*n
curb = 3*m
while i<n or j<m:
    d = min(a[i],b[j])
    while i<n and a[i]<=d:
        cura-=1
        i+=1
    while j<m and b[j]<=d:
        curb-=1
        j+=1
    
    if cura - curb>bestadv:
        bestadv = cura-curb
        besta = cura
        bestb = curb
##    print(d,i,j,cura,curb,bestadv)

print('{0}:{1}'.format(besta,bestb))

    
        
        



n, a = int(input()), list(map(int, input().split()))
m, b = int(input()), list(map(int, input().split()))

a.sort()
b.sort()

A, B = len(a) * 3, len(b) * 3
i = j = 0
tA, tB = A, B

while (i < len(a) and j < len(b)):
        d = min(a[i], b[j])
        while (i < len(a) and a[i] == d):
            i += 1
            tA -= 1
        while (j < len(b) and b[j] == d):
            j += 1
            tB -= 1
        if (tA - tB > A - B):
            A, B = tA, tB

if (j < len(b)):
    tB = len(b) * 2
    if (tA - tB > A - B):
        A, B = tA, tB

print(A, ':', B, sep = '')

    


def read_pack():

    c = int(input())
    x = list(map(int, str.split(input())))
    x.sort()
    return c, x + [0]

n, a = read_pack()
m, b = read_pack()

i = j = 0
pa = pb = None
while i <= n and j <= m:

    ca = (n - i) * 3 + i * 2
    cb = (m - j) * 3 + j * 2

    if pa is None or (ca - cb > pa - pb) or (ca - cb == pa - pb and ca > pa):

        pa, pb = ca, cb

    if j == m:

        i += 1

    elif i == n:

        j += 1

    elif a[i] < b[j]:

        i += 1

    elif a[i] > b[j]:

        j += 1

    else:

        i += 1
        j += 1

print(str.format("{}:{}", pa, pb))


n = int(input())
score = list(map(lambda x: [int(x), 0], input().split()))
m = int(input())    
score += list(map(lambda x: [int(x), 1], input().split()))
score.sort()
f = []
if score[0][1] == 0:
    f.append([1, 0])
else:
    f.append([0, 1])
for i in range(1, n + m):
    if score[i][1] == 0:
        f.append([f[i-1][0] + 1, f[i-1][1]])
    else:
        f.append([f[i-1][0], f[i-1][1] + 1])

a, b = f[-1][0] * 2, f[-1][1] * 2
aa, bb = f[-1][0] * 3, f[-1][1] * 3
if (aa - bb) > (a - b) or (aa - bb == a - b and aa > a):
    a, b = aa, bb
for i in range(n + m - 1):
    if score[i][0] != score[i+1][0]:
        aa = f[i][0] * 2 + (f[-1][0] - f[i][0]) * 3
        bb = f[i][1] * 2 + (f[-1][1] - f[i][1]) * 3
        if (aa - bb) > (a - b) or (aa - bb == a - b and aa > a):
            a, b = aa, bb
print(a, ':', b, sep='')            


from itertools import chain
from bisect import bisect_left as bisect


def main():
    n = int(input().strip())
    aa = list(map(int, input().strip().split()))
    aa.sort()
    m = int(input().strip())
    bb = list(map(int, input().strip().split()))
    bb.sort()
    res = []
    dd = set(chain(aa, bb))
    for d in chain(aa, bb):
        dd.add(d + 1)
    la = len(aa) * 3
    lb = len(bb) * 3
    for d in dd:
        a = la - bisect(aa, d)
        b = lb - bisect(bb, d)
        res.append((a - b, a))
    b, a = max(res)
    print('{:n}:{:n}'.format(a, a - b))


main()

n,_a=int(input()),list(map(int,input().split()))
m,_b=int(input()),list(map(int,input().split()))
p=[(ai,0) for ai in _a] + [(bi,1) for bi in _b]
p.sort()
i=0
R=[len(_a)*3,len(_b)*3]
r=list(R)
while i<len(p):
  d = p[i][0]
  while i<len(p) and p[i][0]==d:
    r[p[i][1]] -= 1
    i += 1
  if (r[0]-r[1] > R[0]-R[1]):
    R=list(r)
print(*R,sep=':')


n1=int(input())
d1=list([int(x) for x in input().split(' ')])

n2=int(input())
d2=list([int(x) for x in input().split(' ')])


dl=list(set([0]+d1+d2))
dl.sort()

dd=dict()
for i in range(0,len(dl)):
    dd[dl[i]]=i

c1=[0 for i in range(0,len(dl))]
c2=[0 for i in range(0,len(dl))]

s1=[0 for i in range(0,len(dl))]
s2=[0 for i in range(0,len(dl))]

for d in d1:
    c1[dd[d]]+=1

for d in d2:
    c2[dd[d]]+=1

for i in range(len(dl)-2,-1,-1):
    s1[i]=s1[i+1]+c1[i+1]
    s2[i]=s2[i+1]+c2[i+1]

maxsub=s1[0]-s2[0]
maxi=0
maxa=s1[0]
for i in range(0,len(dl)):
    sub=s1[i]-s2[i]
    if sub>maxsub or (sub==maxsub and s1[i]>maxa):
        maxsub=sub
        maxa=s1[i]
        maxi=i

print(str(n1*2+s1[maxi])+':'+str(n2*2+s2[maxi]))



__author__ = 'zhan'

first = []
second = []

n = int(input())
line = input().split()
for i in range(n):
    first.append(int(line[i]))
first.sort()

m = int(input())
line = input().split()
for i in range(m):
    second.append(int(line[i]))
second.sort()


a = 3 * n
b = 3 * m
d = a - b
penalty = [0, 0]
i = 0
j = 0

while i < n and j < m:
    t = min(first[i], second[j])
    while i < n and first[i] <= t:
        i += 1
        penalty[0] += 1
    while j < m and second[j] <= t:
        j += 1
        penalty[1] += 1
    if 3*n - penalty[0] - 3*m + penalty[1] > d:
        a = 3 * n - penalty[0]
        b = 3 * m - penalty[1]
        d = 3*n - penalty[0] - 3*m + penalty[1]

if 2 * n - 2 * m > d:
    a = 2 * n
    b = 2 * m

print(str(a)+":"+str(b))



__author__ = 'zhan'

n = int(input())
first = sorted([int(i) for i in input().split()])

m = int(input())
second = sorted([int(i) for i in input().split()])

a = pa = 3 * n
b = pb = 3 * m
d = a - b

i = 0
j = 0

while i < n and j < m:
    t = min(first[i], second[j])
    while i < n and first[i] <= t:
        i += 1
        pa -= 1
    while j < m and second[j] <= t:
        j += 1
        pb -= 1
    if pa - pb > d:
        a = pa
        b = pb
        d = pa - pb

if 2 * n - 2 * m > d:
    a = 2 * n
    b = 2 * m

print(str(a)+":"+str(b))



from collections import defaultdict
#import numpy as np

def main2(n,a,m,b):
    mx = -999
    a.sort()
    b.sort()
    ar = a.copy()
    ar.reverse()
    br = b.copy()
    br.reverse()
    a2 = 0  # last b 2p
    b2 = 0  # last a 2p
    a3 = n
    b3 = m
    #for d in set([0]+a+b):
    for d in sorted(list(set([0]+a+b))):
        #s1 = n*2 + sum([i>d for i in a])
        #s2 = m*2 + sum([i>d for i in b])
        #if a.count(d+1) > 0: a2 = a.index(d+1)
        #if b.count(d+1) > 0: b2 = b.index(d+1)
        #s1 = a2 * 2 + (n-a2)*3
        #s2 = b2 * 2 + (m-b2)*3
        if ar.count(d) > 0: a3 = ar.index(d)
        if br.count(d) > 0: b3 = br.index(d)
        s1 = (n-a3) * 2 + a3*3
        s2 = (m-b3) * 2 + b3*3
        #print(d,s1,s2, a3, b3)
        if s1-s2 > mx:
            mx = s1-s2
            res = "{}:{}".format(s1,s2)
    print(res)
def main(n,a,m,b):
    mx = -99999999999
    a.sort()
    b.sort()
    a2 = 0  # last b 2p
    b2 = 0  # last a 2p
    #ar = a.copy()
    #ar.reverse()
    #br = b.copy()
    #br.reverse()
    #a3 = n
    #b3 = m
    #for d in set([0]+a+b):
    for d in sorted(list(set([0]+a+b))):
        #s1 = n*2 + sum([i>d for i in a])
        #s2 = m*2 + sum([i>d for i in b])
        #if a.count(d+1) > 0: a2 = a.index(d+1)
        #if b.count(d+1) > 0: b2 = b.index(d+1)
        #s1 = a2 * 2 + (n-a2)*3
        #s2 = b2 * 2 + (m-b2)*3
        #if ar.count(d) > 0: a3 = ar.index(d)
        #if br.count(d) > 0: b3 = br.index(d)
        #s1 = (n-a3) * 2 + a3*3
        #s2 = (m-b3) * 2 + b3*3
        for a2 in range(a2,n+1):
            if a2==n or a[a2] > d: break
        for b2 in range(b2,m+1):
            if b2==m or b[b2] > d: break
        s1 = a2 * 2 + (n-a2)*3
        s2 = b2 * 2 + (m-b2)*3
#        print(d,s1,s2, a2, b2)
        if s1-s2 > mx:
            mx = s1-s2
            res = "{}:{}".format(s1,s2)
    print(res)


def main_input():
    n = int(input())
    a = [int(i) for i in input().split()]
    m = int(input())
    b = [int(i) for i in input().split()]

    main(n,a,m,b)

def __starting_point():
    main_input()

__starting_point()

n = int(input())
line = input().split()
a = []
for d in line:
    a.append(int(d))
a.sort()

m = int(input())
line = input().split()
b = []
for d in line:
    b.append(int(d))
b.sort()

arr = [[0, 0, 0]]
i = 0
j = 0
k = 1
while i < n and j < m:
    if a[i] <= b[j]:
        if k > 0 and arr[k - 1][0] == a[i]:
            arr[k - 1][1] += 1
        elif k > 0:
            arr.append([a[i], arr[k - 1][1] + 1, arr[k - 1][2]])
            k += 1
        else:
            arr.append([a[i], 1, 0])
            k += 1
        i += 1
    else:
        if k > 0 and arr[k - 1][0] == b[j]:
            arr[k - 1][2] += 1
        elif k > 0:
            arr.append([b[j], arr[k - 1][1], arr[k - 1][2] + 1])
            k += 1
        else:
            arr.append([b[j], 0, 1])
            k += 1
        j += 1

while i < n:
    if arr[k - 1][0] == a[i]:
        arr[k - 1][1] += 1
    else:
        arr.append([a[i], arr[k - 1][1] + 1, arr[k - 1][2]])
        k += 1
    i += 1

while j < m:
    if arr[k - 1][0] == b[j]:
        arr[k - 1][2] += 1
    else:
        arr.append([b[j], arr[k - 1][1], arr[k - 1][2] + 1])
        k += 1
    j += 1

arr.append([0, n, m])

ans = [3 * n, 3 * m]
for lst in arr:
    tans = [2 * lst[1] + 3 * (n - lst[1]), 2 * lst[2] + 3 * (m - lst[2])]
    if tans[0] - tans[1] > ans[0] - ans[1]:
        ans = list(tans)

ans = str(ans[0]) + ':' + str(ans[1])
print(ans)


import bisect
def input_split(f): return list(map(f, input().split()))


def main():
    n = int(input())
    a = sorted(list(input_split(int)))
    m = int(input())
    b = sorted(list(input_split(int)))
    res = -99999999999999
    res_str = ""
    res_a = -999999999999999

    def sum_p(p_list, d):
        if p_list[-1] < d:
            sum_a = len(p_list)*2
        else:
            t = bisect.bisect_left(p_list, d)
            sum_a = t * 2 + (len(p_list)-t)*3
        return sum_a

    for v in set(a+b+[99999999999999]):
        d = v
        sum_a = sum_p(a, d)
        sum_b = sum_p(b, d)
        import sys
        dp = lambda x: sys.stderr.write(str(x)+"\n")
        dp("d:{}, a:{}, b:{}, res_a: {}".format(d, sum_a, sum_b, res_a))

        if res < sum_a - sum_b or (res == sum_a - sum_b and res_a < sum_a):
            res = sum_a - sum_b
            res_a = sum_a
            res_str = "{}:{}".format(sum_a, sum_b)
    print(res_str)


def __starting_point():
    main()

__starting_point()

def solve(a,b):
	n = len(a)
	m = len(b)

	a = sorted(a)
	b = sorted(b)
	r1 = n * 3
	r2 = m * 3

	max1 = r1
	max2 = r2

	p1 = 0
	p2 = 0
	while p1 < n or p2 < m:
		v = 0
		if p2 == m:
			v = a[p1]
		elif p1 == n:
			v = b[p2]
		else:
			v =min(a[p1],b[p2])

		while p1 < n and a[p1] == v:
			r1 -= 1
			p1 += 1

		while p2 < m and b[p2] == v:
			r2 -= 1
			p2 += 1

		if r1 - r2 > max1 - max2 or (r1-r2 == max1-max2 and r1 > max1):
			max1 = r1
			max2 = r2

	return (max1, max2)

n = input()
a = list(map(int, input().split(' ')))
n = input()
b = list(map(int, input().split(' ')))

print('%s:%s' % solve(a,b))



def merge(l1,l2):
    p1 = 0
    p2 = 0
    l = []
    while ((p1 < len(l1)) and (p2 < len(l2))):
        if l1[p1] < l2[p2]:
            l.append(l1[p1])
            p1 += 1
        else:
            l.append(l2[p2])
            p2 += 1
    if p1 < len(l1):
        l.extend(l1[p1:len(l1)])
    if p2 < len(l2):
        l.extend(l2[p2:len(l2)])
    return l

def merge_sort(l):
    if len(l) == 1:
        return l
    else:
        l1 = merge_sort(l[0:len(l)//2])
        l2 = merge_sort(l[len(l)//2:len(l)])
        return merge(l1, l2)


n = int(input())       
dist_str = input()
first_dist = list([int(s) for s in dist_str.split(' ')])
m = int(input())
dist_str = input()
second_dist = list([int(s) for s in dist_str.split(' ')])

#merge_sort(first_dist)
#merge_sort(second_dist)
first_dist.sort()
second_dist.sort()
first_sum = 3 * n
second_sum = 3 * m
diff = first_sum - second_sum

thr_p1 = 0
thr_p2 = 0

first_sum_temp = first_sum
second_sum_temp = second_sum
diff_temp = diff

while ((thr_p1 < n) and (thr_p2 < m)):
    if first_dist[thr_p1] < second_dist[thr_p2]:
        first_sum_temp -= 1
        thr_p1 += 1
    elif first_dist[thr_p1] > second_dist[thr_p2]:
        second_sum_temp -= 1
        thr_p2 += 1
    else:
        first_sum_temp -= 1
        second_sum_temp -= 1
        thr_p2 += 1
        thr_p1 += 1
        
    diff_temp = first_sum_temp - second_sum_temp

    if diff_temp > diff:
        diff = diff_temp
        first_sum = first_sum_temp
        second_sum = second_sum_temp


while thr_p1 < n:
    first_sum_temp -= 1
    thr_p1 += 1
    diff_temp = first_sum_temp - second_sum_temp

    if diff_temp > diff:
        diff = diff_temp
        first_sum = first_sum_temp
        second_sum = second_sum_temp

while thr_p2 < m:
    second_sum_temp -= 1
    thr_p2 += 1
    diff_temp = first_sum_temp - second_sum_temp

    if diff_temp > diff:
        diff = diff_temp
        first_sum = first_sum_temp
        second_sum = second_sum_temp

ans = str(first_sum) + ':' + str(second_sum)
print(ans)




n = int(input())
score = list(map(lambda x: [int(x), 0], input().split()))
m = int(input())    
score += list(map(lambda x: [int(x), 1], input().split()))
score.sort()
f = []
if score[0][1] == 0:
    f.append([1,  0])
else:
    f.append([0, 1])
for i in range(1, n + m):
    if score[i][1] == 0:
        f.append([f[i-1][0] + 1, f[i-1][1]])
    else:
        f.append([f[i-1][0], f[i-1][1] + 1])

a, b = f[-1][0] * 2, f[-1][1] * 2
aa, bb = f[-1][0] * 3, f[-1][1] * 3
if (aa - bb) > (a - b) or (aa - bb == a - b and aa > a):
    a, b = aa, bb
for i in range(n + m - 1):
    if score[i][0] != score[i+1][0]:
        aa = f[i][0] * 2 + (f[-1][0] - f[i][0]) * 3
        bb = f[i][1] * 2 + (f[-1][1] - f[i][1]) * 3
        if (aa - bb) > (a - b) or (aa - bb == a - b and aa > a):
            a, b = aa, bb
print(a, ':', b, sep='')   

import bisect

n = int(input()) 
a = [int(x) for x in input().split()]
a.sort()
m = int(input()) 
b = [int(x) for x in input().split()]
b.sort() 
maxRes = n*3-m*3
pos = [n*3, m*3]
for i in range(n):
    k = bisect.bisect_left(b, a[i])
    res = (i*2+(n-i)*3)-(k*2+(m-k)*3)
    #print(res)
    if (res > maxRes) or ((res == maxRes) and (i*2+(n-i)*3 > pos[0])):
        maxRes = res
        pos = [i*2+(n-i)*3, k*2+(m-k)*3] 
    #print(i, k, pos) 
if (n*2-m*2 > maxRes) or ((n*2-m*2 == maxRes) and (n*2 > pos[0])) :
    pos = [n*2, m*2]
print(':'.join(list(map(str, pos))))

n=int(input())
a=sorted([int(i) for i in input().split()])
m=int(input())
b=sorted([int(i) for i in input().split()])

ma=a1=3*n; mb=b1=3*m; rast=a1-b1; i,j=0,0
while i<n and j<m:
    z=min(a[i],b[j])
    while i<n and a[i]<=z:
        i+=1; ma-=1
    while j<m and b[j]<=z:
        j+=1; mb-=1
    if ma-mb > rast:
        a1, b1= ma, mb
        rast=a1-b1
if 2*n-2*m>rast:
    a1,b1=2*n, 2*m
print("%d:%d"%(a1,b1))



from sys import stdin
from heapq import heapify
inFile = stdin
tokens = []
tokens_next = 0

def next_str():
    nonlocal tokens, tokens_next
    while tokens_next >= len(tokens):
        tokens = inFile.readline().split()
        tokens_next = 0
    tokens_next += 1
    return tokens[tokens_next - 1]

def nextInt():
    return int(next_str())

def score(a, d):
	low = -1
	high = len(a)
	while low + 1 < high:
		mid = (low + high) // 2
		if a[mid] <= d:
			low = mid
		else:
			high = mid
	return (low + 1) * 2 + (len(a) - (low + 1)) * 3

def diff(a, b, d):
	return score(a, d) - score(b, d)

n = nextInt()
a = [nextInt() for i in range(n)]
n = nextInt()
b = [nextInt() for i in range(n)]

a.sort()
b.sort()

best_dis = 0
best_score = diff(a, b, best_dis)

for d in a + b:
	cur = diff(a, b, d)
	if cur > best_score:
		best_dis = d
		best_score = cur
	elif cur == best_score:
		if score(a, d) > score(a, best_dis):
			best_dis = d
			best_score = cur

# print score(a, best_dis), ':', score(b, best_dis)
print('%d:%d'%(score(a, best_dis), score(b, best_dis)))

read = lambda: map(int, input().split())
n = int(input())
a = sorted(read())[::-1]
m = int(input())
b = sorted(read())[::-1]
x, y = 2 * n, 2 * m
j = 0
for i in range(n):
    while j < m and b[j] >= a[i]:
        j += 1
    x1 = i + 1 + 2 * n
    y1 = j + 2 * m
    if x1 - y1 > x - y or (x1 - y1 == x - y and x1 > x):
        x, y = x1, y1
print(x, y, sep = ':')


def lte(n, a, d):
    # count the number of values in a <= d
    if a[0] > d:
        return 0
    if a[-1] <= d:
        return n
    else:
        lo = 0
        hi = n - 1
        while lo + 1 < hi:
            mid = (lo + hi) // 2
            if a[mid] <= d:
                lo = mid
            else:
                hi = mid
        return lo + 1

def score(n, m, a, b, d):
    ca = lte(n, a, d)
    cb = lte(m, b, d)

    a_score = 2 * ca + 3 * (n - ca)
    b_score = 2 * cb + 3 * (m - cb)

    return a_score, b_score


def main():
    n = int(input())
    a = list(map(int, input().split()))

    m = int(input())
    b = list(map(int, input().split()))

    a.sort()
    b.sort()

    factor = 2 if 2 * (n - m) > 3 * (n - m) else 3
    best_diff = factor * (n - m)
    best_a = factor * n
    out = str(factor * n) + ':' + str(factor * m)

    mega = set(a + b)

    for d in mega:
        if d <= 0: 
            continue

        a_score, b_score = score(n, m, a, b, d)
        diff = a_score - b_score

        if diff > best_diff or (diff == best_diff and a_score > best_a):
            best_diff = diff
            best_a = a_score
            out = str(a_score) + ':' + str(b_score)

    print(out)

main()


"""
	Author		: Arif Ahmad
	Date  		: 
	Algo  		: 
	Difficulty	: 
"""

def main():
	n = int(input())
	t1 = [int(_) for _ in input().split()]
	t1 = sorted(t1)

	m = int(input())
	t2 = [int(_) for _ in input().split()]
	t2 = sorted(t2)

	a = x = 3 * n
	b = y = 3 * m
	advantage = a - b
	i = 0
	j = 0
	while i<n or j<m:
		if i<n and j<m:
			if t1[i] < t2[j]:
				x -= 1
				i += 1
			elif t2[j] < t1[i]:
				y -= 1
				j += 1
			else:
				x -= 1
				y -= 1
				i += 1
				j += 1
		elif i < n:
			x -= 1
			i += 1
		else:
			y -= 1
			j += 1

		if (x - y) > advantage:
			a = x
			b = y
			advantage = a - b

	print('%d:%d' % (a, b))


def __starting_point():
    main()
    

__starting_point()

I = lambda: list(map(int, input().split()))
n = I()[0]
d1 = [0]+sorted(I())
m = I()[0]
d2 = [0]+sorted(I())

index1, index2 = {}, {}
index1[0], index2[0] = n, m
i, j = n, m
while (i>=0 and j>=0):
    maxd = max(d1[i], d2[j])
    if not(maxd in index1):
        index1[maxd] = n - i 
    if not(maxd in index2):
        index2[maxd] = m - j 
    if d1[i] == maxd:
        i -= 1
    if d2[j] == maxd:
        j -= 1
while (i>=0):
    if not(d1[i] in index1):
        index1[d1[i]] = n - i
    i -= 1
while (j>=0):
    if not(d2[j] in index2):
        index2[d2[j]] = m - j
    j -= 1                
    
a, b, maxdiff = 0, 0, -1e100
for foo in [0] + d1 + d2:
    i = index1[foo]
    j = index2[foo]
    _a, _b = i * 3 + (n - i) * 2, j * 3 + (m - j) * 2
    diff = _a - _b
    if (diff > maxdiff) or (diff == maxdiff and _a > a):
        maxdiff = diff
        a, b = _a, _b
print('%d:%d' % (a,b))