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: MEDIUM_HARD

Solutions:
def binary_search(arr, n, k):
	(l, r) = (0, n - 1)
	while l <= r:
		mid = l + r >> 1
		if arr[mid] <= k:
			l = mid + 1
		else:
			r = mid - 1
	return l
n = int(input())
arr1 = list(map(int, input().split()))
m = int(input())
arr2 = list(map(int, input().split()))
arr1.sort()
arr2.sort()
(res1, res2) = (2 * n, 2 * m)
for i in range(n):
	sum1 = 2 * i + 3 * (n - i)
	j = binary_search(arr2, m, arr1[i] - 1)
	sum2 = 2 * j + 3 * (m - j)
	diff_sum = sum1 - sum2
	diff_res = res1 - res2
	if diff_sum > diff_res or (diff_sum == diff_res and sum1 > res1):
		(res1, res2) = (sum1, sum2)
print('%d:%d' % (res1, res2))


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('{0}:{1}'.format(besta, bestb))


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, -1e+100)
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))


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(' ')])
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())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
c = sorted([[a[i], 1] for i in range(n)] + [[b[i], 2] for i in range(m)])
x = x0 = 2 * n
y = y0 = 2 * m
for i in range(n + m - 1, -1, -1):
	if c[i][1] == 1:
		x += 1
	else:
		y += 1
	if x - y >= x0 - y0:
		(x0, y0) = (x, y)
print(x0, y0, sep=':')


import os, sys, atexit
from io import BytesIO, StringIO
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
_OUTPUT_BUFFER = StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
a.sort()
b.sort()
scorea = 3 * n
scoreb = 3 * m
ans = scorea - scoreb
ansa = scorea
ansb = scoreb
i = 0
j = 0
while 1:
	if i == n or j == m:
		break
	mn = min(a[i], b[j])
	while 1:
		if i == n:
			break
		if a[i] == mn:
			scorea += -1
		else:
			break
		i -= -1
	while 1:
		if j == m:
			break
		if b[j] == mn:
			scoreb += -1
		else:
			break
		j -= -1
	if scorea - scoreb > ans:
		ans = scorea - scoreb
		ansa = scorea
		ansb = scoreb
if ansa - ansb < 2 * n - 2 * m:
	(ansa, ansb) = (2 * n, 2 * m)
print(ansa, ':', ansb, sep='')


import sys
input = sys.stdin.buffer.readline

def I():
	return list(map(int, input().split()))

def sieve(n):
	a = [1] * n
	for i in range(2, n):
		if a[i]:
			for j in range(i * i, n, i):
				a[j] = 0
	return a
n = int(input())
a = sorted(I())
m = int(input())
b = sorted(I())
c = sorted(a + b)
p1 = 0
p2 = 0
s1 = 0
s2 = 0
ans = [3 * n, 3 * m]
for d in c:
	while p1 < n and a[p1] <= d:
		p1 += 1
	while p2 < m and b[p2] <= d:
		p2 += 1
	scorea = 2 * p1 + 3 * (n - p1)
	scoreb = 2 * p2 + 3 * (m - p2)
	(curra, currb) = ans
	if (scorea - scoreb, scorea) >= (curra - currb, curra):
		ans = [scorea, scoreb]
print(str(ans[0]) + ':' + str(ans[1]))


__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 bisect import bisect_left
n = int(input())
a = [int(x) for x in input().split()]
m = int(input())
b = [int(x) for x in input().split()]
a.sort()
b.sort()
three = 0
maxdif = -10 ** 10
for i in range(n):
	bi = bisect_left(b, a[i])
	dif = (n - i) * 3 + (i + 1) * 2 - ((m - bi) * 3 + (bi + 1) * 2)
	if dif > maxdif:
		three = a[i]
		maxdif = dif
if n * 2 - m * 2 > maxdif:
	three = 10 ** 10
(sa, sb) = (0, 0)
for x in a:
	if x >= three:
		sa += 3
	else:
		sa += 2
for x in b:
	if x >= three:
		sb += 3
	else:
		sb += 2
print(str(sa) + ':' + str(sb))


n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
a.sort()
b.sort()
diff = 2 * n - 2 * m
j = 0
ans = [(2 * n, 2 * m)]
for i in range(n):
	while j < m:
		if b[j] <= a[i] - 1:
			j += 1
		else:
			break
	ap = 2 * i + 3 * (n - i)
	bp = 2 * j + 3 * (m - j)
	if ap - bp > diff:
		diff = ap - bp
		ans = [(ap, bp)]
	elif ap - bp == diff:
		ans.append((ap, bp))
fans = max(ans, key=lambda x: x[0])
print(str(fans[0]) + ':' + str(fans[1]))


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))

def read(mode=2):
	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())


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()


from itertools import permutations as perm
from collections import *
from sys import stdin
from bisect import *
from heapq import *
from math import *
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
g()
a = Counter(gil())
g()
b = Counter(gil())
c = list(set(a.keys()) | set(b.keys()))
c.sort()
nc = len(c)
l = []
for i in range(nc):
	(ap, bp) = l[-1] if l else (0, 0)
	ap += a.get(c[i], 0) * 2
	bp += b.get(c[i], 0) * 2
	l.append([ap, bp])
r = [None for _ in range(nc)]
for i in reversed(range(nc)):
	(an, bn) = r[i + 1] if i + 1 < nc else (0, 0)
	an += a.get(c[i], 0) * 3
	bn += b.get(c[i], 0) * 3
	r[i] = [an, bn]
ans = max(r[0], l[-1], key=lambda x: (x[0] - x[1], x[0]))
for i in range(nc - 1):
	(asum, bsum) = l[i]
	asum += r[i + 1][0]
	bsum += r[i + 1][1]
	ans = max(ans, [asum, bsum], key=lambda x: (x[0] - x[1], x[0]))
ans = tuple(ans)
print('%d:%d' % ans)


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
I = lambda : list(map(int, input().split()))
from bisect import bisect as br
(n,) = I()
a = I()
a.sort()
(m,) = I()
b = [0] + I()
b.sort()
ansa = 0
ansb = 0
mx = -10000000000000000
for i in range(m + 1):
	k = br(a, b[i])
	bb = 2 * i + 3 * (m - i)
	aa = k * 2 + 3 * (n - k)
	if aa - bb > mx:
		mx = aa - bb
		ansa = aa
		ansb = bb
	if mx == aa - bb and aa > ansa:
		ansa = aa
		ansb = bb
print(ansa, ':', ansb, sep='')


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=':')


n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
a.sort()
b.sort()
(x, y) = (0, -1)
(u, v) = (n * 3, m * 3)
q = [u, v]
while 1:
	if y != m - 1:
		y += 1
		v -= 1
	while x < n and a[x] <= b[y]:
		x += 1
		u -= 1
	if u - v > q[0] - q[1]:
		q = [u, v]
	if (x == n or a[x] > b[y]) and y == m - 1:
		break
print('%i:%i' % (q[0], q[1]))


from sys import stdin, stdout

def solution():
	n = int(stdin.readline().rstrip())
	a = list(map(lambda x: (int(x), 1), stdin.readline().rstrip().split()))
	m = int(stdin.readline().rstrip())
	b = list(map(lambda x: (int(x), 2), stdin.readline().rstrip().split()))
	c = a + b
	c.sort(key=lambda tup: tup[0])
	aa = n * 3
	af = n * 3
	bf = m * 3
	bb = m * 3
	d = aa - bb
	prev = -1
	for elem in c:
		if prev != elem[0]:
			prev = elem[0]
			if aa - bb > d:
				d = aa - bb
				af = aa
				bf = bb
		if elem[1] == 1:
			aa -= 1
		else:
			bb -= 1
	if aa - bb > d:
		d = aa - bb
		af = aa
		bf = bb
	stdout.write('{}:{}'.format(af, bf))
solution()


__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='')


input = __import__('sys').stdin.readline
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
lis = [[i, 0] for i in a] + [[i, 1] for i in b]
lis.sort()
zer = one = aa = bb = 0
ans = -10000000000000000000
for i in range(len(lis)):
	if lis[i][1] == 0:
		zer += 1
	else:
		one += 1
	tma = n * 3 - zer
	tmb = m * 3 - one
	if tma - tmb > ans:
		ans = tma - tmb
		aa = tma
		bb = tmb
if n * 3 - m * 3 >= ans:
	ans = n * 3 - m * 3
	aa = n * 3
	bb = m * 3
print(aa, ':', bb, sep='')


import os
import sys
from io import BytesIO, IOBase
from bisect import bisect_right as br

def main():
	n = int(input())
	a = list(map(int, input().split(' ')))
	m = int(input())
	b = list(map(int, input().split(' ')))
	a.sort()
	b.sort()
	ansa = 3 * n
	ansb = 3 * m
	ans = ansa - ansb
	for x in range(len(a)):
		for y in range(-1, 2):
			idxa = br(a, a[x] + y)
			herea = idxa * 2 + (n - idxa) * 3
			idxb = br(b, a[x] + y)
			hereb = idxb * 2 + (m - idxb) * 3
			if herea - hereb > ans:
				ansa = herea
				ansb = hereb
				ans = herea - hereb
			if herea - hereb == ans:
				if herea > ansa:
					ansa = herea
					ansb = hereb
					ans = herea - hereb
	for x in range(len(b)):
		for y in range(-1, 2):
			idxb = br(b, b[x] + y)
			hereb = idxb * 2 + (m - idxb) * 3
			idxa = br(a, b[x] + y)
			herea = idxa * 2 + (n - idxa) * 3
			if herea - hereb > ans:
				ansa = herea
				ansb = hereb
				ans = herea - hereb
			if herea - hereb == ans:
				if herea > ansa:
					ansa = herea
					ansb = hereb
					ans = herea - hereb
	print(ansa, ':', ansb, sep='')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def lowerBound(A, d):
	ans = -1
	(low, high) = (0, len(A) - 1)
	while low <= high:
		mid = (low + high) // 2
		if A[mid] <= d:
			ans = mid
			low = mid + 1
		else:
			high = mid - 1
	return ans + 1
n = int(input())
A = list(map(int, input().split()))
m = int(input())
B = list(map(int, input().split()))
(A, B) = (sorted(A), sorted(B))
(low, high) = (0, max(max(A), max(B)) + 1)
m = -10 ** 10
(ansA, ansB) = (0, 0)
for i in range(len(A)):
	d = A[i]
	loc = lowerBound(A, d)
	pointsA = loc * 2 + (len(A) - loc) * 3
	loc = lowerBound(B, d)
	pointsB = loc * 2 + (len(B) - loc) * 3
	if m <= pointsA - pointsB:
		if pointsA - pointsB == m:
			if pointsA > ansA:
				(ansA, ansB) = (pointsA, pointsB)
		else:
			m = pointsA - pointsB
			(ansA, ansB) = (pointsA, pointsB)
for i in range(len(B)):
	d = B[i]
	loc = lowerBound(A, d)
	pointsA = loc * 2 + (len(A) - loc) * 3
	loc = lowerBound(B, d)
	pointsB = loc * 2 + (len(B) - loc) * 3
	if m <= pointsA - pointsB:
		if pointsA - pointsB == m:
			if pointsA > ansA:
				(ansA, ansB) = (pointsA, pointsB)
		else:
			m = pointsA - pointsB
			(ansA, ansB) = (pointsA, pointsB)
for x in [low, high]:
	d = x
	loc = lowerBound(A, d)
	pointsA = loc * 2 + (len(A) - loc) * 3
	loc = lowerBound(B, d)
	pointsB = loc * 2 + (len(B) - loc) * 3
	if m <= pointsA - pointsB:
		if pointsA - pointsB == m:
			if pointsA > ansA:
				(ansA, ansB) = (pointsA, pointsB)
		else:
			m = pointsA - pointsB
			(ansA, ansB) = (pointsA, pointsB)
print('{}:{}'.format(ansA, ansB))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
arr = list(map(int, input().split()))
arr.sort(reverse=True)
m = int(input())
ls = list(map(int, input().split()))
ls.sort(reverse=True)
(a, b) = (2 * n, 2 * m)
j = 0
for i in range(n):
	while j < m and ls[j] >= arr[i]:
		j += 1
	(a1, b1) = (i + 1 + 2 * n, j + 2 * m)
	if a1 - b1 > a - b or (a1 - b1 == a - b and a1 > a):
		(a, b) = (a1, b1)
print(a, b, sep=':')


(n, a) = (int(input()), list(map(int, input().split())))
(m, b) = (int(input()), list(map(int, input().split())))
p = [(i, 0) for i in a] + [(i, 1) for i in b]
p.sort()
i = 0
score = [n * 3, m * 3]
score_temp = list(score)
while i < m + n:
	d = p[i][0]
	while i < m + n and p[i][0] == d:
		score_temp[p[i][1]] -= 1
		i += 1
	if score_temp[0] - score_temp[1] > score[0] - score[1]:
		score = list(score_temp)
print(*score, 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))


from collections import defaultdict

def main2(n, a, m, b):
	mx = -999
	a.sort()
	b.sort()
	ar = a.copy()
	ar.reverse()
	br = b.copy()
	br.reverse()
	a2 = 0
	b2 = 0
	a3 = n
	b3 = m
	for d in sorted(list(set([0] + a + b))):
		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
		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
	b2 = 0
	for d in sorted(list(set([0] + a + b))):
		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
		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()


__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))


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = list(map(int, input().split()))
	m = int(input())
	b = list(map(int, input().split()))
	ls = []
	for i in range(n):
		ls.append((a[i], 'a'))
	for j in range(m):
		ls.append((b[j], 'b'))
	ls.sort()
	alen = len(ls)
	a_cnt = 3 * n
	b_cnt = 3 * m
	a_res = a_cnt
	b_res = b_cnt
	ans = a_cnt - b_cnt
	for i in range(alen):
		if ls[i][1] == 'a':
			a_cnt -= 1
		else:
			b_cnt -= 1
		if a_cnt - b_cnt > ans:
			ans = a_cnt - b_cnt
			a_res = a_cnt
			b_res = b_cnt
	print('{}:{}'.format(a_res, b_res))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n1 = int(input())
d1 = list(map(lambda x: int(x), input().split(' ')))
n2 = int(input())
d2 = list(map(lambda x: int(x), 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]))


(f, s) = ([], [])
n = int(input())
f.extend(map(int, input().split()))
m = int(input())
s.extend(map(int, input().split()))
f.append(1 << 64)
s.append(1 << 64)
f = sorted(f)
s = sorted(s)
mxA = scoreA = 3 * n
mxB = scoreB = 3 * m
mxDif = scoreA - scoreB
(i, j) = (0, 0)
while i < n or j < m:
	if f[i] < s[j]:
		scoreA -= 1
		i += 1
	elif f[i] > s[j]:
		scoreB -= 1
		j += 1
	else:
		scoreA -= 1
		i += 1
		scoreB -= 1
		j += 1
	if scoreA - scoreB > mxDif:
		mxDif = scoreA - scoreB
		mxA = scoreA
		mxB = scoreB
print(str(mxA) + ':' + str(mxB))


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

def next_str():
	global 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('%d:%d' % (score(a, best_dis), score(b, best_dis)))


n = int(input())
lis = [[int(i), 'a'] for i in input().split()]
m = int(input())
lis = lis + [[int(i), 'b'] for i in input().split()] + [[0, 'a']] + [[0, 'b']]
lis.sort()
a = b = 0
ans = -1000000
fin = finb = 0
for i in range(len(lis) - 1):
	if lis[i][1] == 'a':
		a += 1
	else:
		b += 1
	if lis[i][0] != lis[i + 1][0]:
		aa = (a - 1) * 2 + (n - a + 1) * 3
		bb = (b - 1) * 2 + (m - b + 1) * 3
		if ans < aa - bb:
			ans = aa - bb
			fin = aa
			finb = bb
		elif ans == aa - bb:
			if fin < aa:
				fin = aa
				finb = bb
if lis[-1][1] == 'a':
	a += 1
else:
	b += 1
aa = 2 * n
bb = 2 * m
if ans < aa - bb:
	fin = aa
	finb = bb
elif ans == aa - bb:
	if fin < aa:
		fin = aa
		finb = bb
print(fin, ':', finb, sep='')


import bisect

def distNums(team):
	scores = {}
	for i in team:
		if i not in scores.keys():
			scores[i] = 1
		else:
			scores[i] += 1
	team = []
	for i in scores.keys():
		team.append(i)
	team.sort()
	dp = []
	for i in team:
		if not dp:
			dp.append(scores[i])
		else:
			dp.append(dp[-1] + scores[i])
	return (team, dp)

def main():
	n = int(input())
	team1 = list(map(int, input().split()))
	m = int(input())
	(team2, dp) = distNums(list(map(int, input().split())))
	team1.sort()
	max_diff = 3 * (n - m)
	a = 3 * n
	b = 3 * m
	for i in range(len(team2)):
		throw2 = team2[i]
		total = dp[i]
		score2 = 3 * (dp[-1] - dp[i]) + 2 * total
		index = bisect.bisect(team1, throw2)
		score1 = 2 * index + 3 * (n - index)
		diff = score1 - score2
		if diff > max_diff:
			max_diff = diff
			a = score1
			b = score2
		elif diff == max_diff:
			if score1 > a:
				a = score1
				b = score2
	print(str(a) + ':' + str(b))
main()


R = lambda : map(int, input().split())
n = int(input())
a = sorted(R()) + [int(2 * 10 ** 9) + 1]
m = int(input())
b = sorted(R()) + [int(2 * 10 ** 9) + 1]
(i, j) = (0, 0)
(ra, rb) = (n * 3, m * 3)
if n * 2 - m * 2 > n * 3 - m * 3:
	(ra, rb) = (n * 2, m * 2)
while i < n or j < m:
	(sa, sb) = (0, 0)
	if i <= n and j <= m and (a[i] < b[j]):
		(sa, sb) = ((i + 1) * 2 + (n - i - 1) * 3, j * 2 + (m - j) * 3)
		i += 1
	elif i <= n and j <= m and (a[i] > b[j]):
		(sa, sb) = (i * 2 + (n - i) * 3, (j + 1) * 2 + (m - j - 1) * 3)
		j += 1
	else:
		(sa, sb) = (i * 2 + (n - i) * 3, j * 2 + (m - j) * 3)
		(i, j) = (i + 1, j + 1)
	if sa - sb == ra - rb and sa > ra or sa - sb > ra - rb:
		(ra, rb) = (sa, sb)
print(str(ra) + ':' + str(rb))


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
a.sort()
b.sort()
(j, k) = (0, 0)
c = []
while j <= n and k <= m:
	if j == n and k == m:
		break
	elif j == n:
		c.append([b[k], 1])
		k += 1
	elif k == m:
		c.append([a[j], 0])
		j += 1
	elif a[j] <= b[k]:
		c.append([a[j], 0])
		j += 1
	elif a[j] >= b[k]:
		c.append([b[k], 1])
		k += 1
cnt_a = 0
cnt_b = 0
ans = 3 * n - 3 * m
res = [3 * n, 3 * m]
for i in range(len(c)):
	(num, id) = c[i]
	if id == 0:
		cnt_a += 1
	else:
		cnt_b += 1
	tmp_a = cnt_a * 2 + (n - cnt_a) * 3
	tmp_b = cnt_b * 2 + (m - cnt_b) * 3
	if ans < tmp_a - tmp_b:
		res = [tmp_a, tmp_b]
		ans = tmp_a - tmp_b
print(str(res[0]) + ':' + str(res[1]))


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()


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))


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 bisect import bisect_right as br
from sys import stdin
input = stdin.readline

def f(a, b):
	A = len(a)
	B = len(b)
	a = sorted(a)
	b = sorted(b)
	ans = set(set(a).union(set(b)))
	(s1, s2) = (-float('inf'), -float('inf'))
	cdif = -float('inf')
	ans.add(a[0] - 1)
	ans.add(b[0] - 1)
	ans.add(b[-1] + 1)
	ans.add(a[-1] + 1)
	for i in ans:
		ind1 = br(a, i)
		ind2 = br(b, i)
		ts1 = (A - ind1) * 3 + ind1 * 2
		ts2 = (B - ind2) * 3 + ind2 * 2
		if ts1 - ts2 >= cdif:
			if ts1 - ts2 > cdif:
				s1 = ts1
				s2 = ts2
				cdif = ts1 - ts2
			elif ts1 > s1:
				s1 = ts1
				s2 = ts2
	print(f'{s1}:{s2}')
a = input()
ls = list(map(int, input().strip().split()))
b = input()
ls2 = list(map(int, input().strip().split()))
f(ls, ls2)


def lte(n, 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()


import os
import sys
from io import BytesIO, IOBase
from bisect import *

def main():
	n = int(input())
	a = list(map(int, input().split()))
	m = int(input())
	b = list(map(int, input().split()))
	a.sort()
	b.sort()
	a = a[::-1]
	dff = 2 * (n - m)
	(x, y) = (2 * n, 2 * m)
	for i in range(n):
		z = a[i]
		zz = bisect_left(b, z)
		dfa = 2 * (n - i - 1) + 3 * (i + 1)
		dfb = 3 * (m - zz) + 2 * zz
		if dff <= dfa - dfb:
			dff = dfa - dfb
			x = dfa
			y = dfb
	print(f'{x}:{y}')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 998244353
EPS = 1e-06

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
a = array()
a = [(1, i) for i in a]
m = Int()
b = array()
b = [(2, i) for i in b]
overall = a + b + [(0, 0)]
overall.sort(key=lambda x: x[1])
overall.append((inf, 0))
distances = {1: 0, 2: 0, 0: 0}
total = {}
ans = [-inf, -inf, -inf]
for i in range(n + m + 1):
	(team, cur_dist) = overall[i]
	(_, next_dist) = overall[i + 1]
	distances[team] += 1
	if cur_dist != next_dist:
		scoreA = distances[1] * 2 + (n - distances[1]) * 3
		scoreB = distances[2] * 2 + (m - distances[2]) * 3
		dif = scoreA - scoreB
		if dif > ans[0]:
			ans = [dif, scoreA, scoreB]
		if dif == ans[0] and scoreA > ans[1]:
			ans = [dif, scoreA, scoreB]
print(*ans[1:], sep=':')


from sys import stdin
from math import inf

def score(d, lst):
	d += 0.1
	l = 0
	r = len(lst) - 1
	while l < r:
		mid = (l + r) // 2
		if lst[mid] < d:
			l = mid + 1
		else:
			r = mid
	if lst[r] < d:
		r += 1
	return r * 2 + 3 * (len(lst) - r)
n = int(stdin.readline())
a = list(map(int, stdin.readline().split()))
a.sort()
m = int(stdin.readline())
b = list(map(int, stdin.readline().split()))
b.sort()
d = 0
curm = -inf
cura = 0
for ele in a:
	sa = score(ele, a)
	sb = score(ele, b)
	if sa - sb > curm or (curm == sa - sb and cura < sa):
		curm = sa - sb
		cura = sa
		d = ele
for ele in b:
	sa = score(ele, a)
	sb = score(ele, b)
	if sa - sb > curm or (curm == sa - sb and cura < sa):
		curm = sa - sb
		cura = sa
		d = ele
ele = a[0] - 0.1
sa = score(ele, a)
sb = score(ele, b)
if sa - sb > curm or (curm == sa - sb and cura < sa):
	curm = sa - sb
	cura = sa
	d = ele
ele = b[0] - 0.1
sa = score(ele, a)
sb = score(ele, b)
if sa - sb > curm or (curm == sa - sb and cura < sa):
	curm = sa - sb
	cura = sa
	d = ele
print(score(d, a), ':', score(d, b), sep='')


from sys import stdin

def binary_search(arr, n, k):
	(l, r) = (0, n - 1)
	while l <= r:
		mid = l + r >> 1
		if arr[mid] <= k:
			l = mid + 1
		else:
			r = mid - 1
	return l

def main():
	n = int(stdin.readline())
	arr1 = list(map(int, stdin.readline().split()))
	m = int(stdin.readline())
	arr2 = list(map(int, stdin.readline().split()))
	arr1.sort()
	arr2.sort()
	(res1, res2) = (2 * n, 2 * m)
	for i in range(n):
		sum1 = 2 * i + 3 * (n - i)
		j = binary_search(arr2, m, arr1[i] - 1)
		sum2 = 2 * j + 3 * (m - j)
		if sum1 - sum2 > res1 - res2 or (sum1 - sum2 == res1 - res2 and sum1 > res1):
			(res1, res2) = (sum1, sum2)
	print('%d:%d' % (res1, res2))
main()


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, _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=':')


from sys import stdout, stdin, maxsize
n = int(input())
team1 = list(map(int, input().split()))
m = int(input())
team2 = list(map(int, input().split()))
ls = []
for i in range(n):
	ls.append([team1[i], 1])
for i in range(m):
	ls.append([team2[i], 2])
ls.sort()
score1 = 3 * n
score2 = 3 * m
ans = [score1, score2]
mx = score1 - score2
for i in range(m + n):
	if ls[i][1] == 1:
		score1 -= 1
	else:
		score2 -= 1
	if score1 - score2 > mx:
		ans = [score1, score2]
		mx = score1 - score2
print(f'{ans[0]}:{ans[1]}')


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)
	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]
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())
lia = list(map(int, input().split(' ', n)[:n]))
m = int(input())
lib = list(map(int, input().split(' ', m)[:m]))
a = [[ai, 0] for ai in lia] + [[bi, 1] for bi in lib]
a.sort()
(x, y) = (3 * n, 3 * m)
(X, Y) = (3 * n, 3 * m)
for i in range(n + m):
	if a[i][1] == 0:
		X -= 1
	else:
		Y -= 1
	if X - Y > x - y:
		(x, y) = (X, Y)
print(x, y, sep=':')


from sys import stdin, stdout
from collections import defaultdict, Counter
from bisect import bisect
import math
I = stdin.readline
n = int(I())
a = [int(x) for x in I().split()]
m = int(I())
b = [int(x) for x in I().split()]
a.sort()
b.sort()
ansa = 3 * n
ansb = 3 * m
if a[0] <= b[0] and n > m:
	for i in range(n):
		posa = bisect(a, a[i])
		posb = bisect(b, a[i])
		sa = 2 * posa + 3 * (n - posa)
		sb = 2 * posb + 3 * (m - posb)
		if sa - sb > ansa - ansb:
			ansa = sa
			ansb = sb
		elif sa - sb == ansa - ansb and sa > ansa:
			ansa = sa
			ansb = sb
else:
	for i in range(m):
		posa = bisect(a, b[i])
		posb = bisect(b, b[i])
		sa = 2 * posa + 3 * (n - posa)
		sb = 2 * posb + 3 * (m - posb)
		if sa - sb > ansa - ansb:
			ansa = sa
			ansb = sb
		elif sa - sb == ansa - ansb and sa > ansa:
			ansa = sa
			ansb = sb
print('%d:%d' % (ansa, ansb))


def binary_search(arr, m, k):
	l = 0
	r = m - 1
	while l <= r:
		mid = (l + r) // 2
		if arr[mid] <= k:
			l = mid + 1
		else:
			r = mid - 1
	return l
n = int(input())
first = list(map(int, input().split()))
m = int(input())
sec = list(map(int, input().split()))
first.sort()
sec.sort()
(res1, res2) = (2 * n, 2 * m)
for i in range(n):
	sum1 = 2 * i + 3 * (n - i)
	x = binary_search(sec, m, first[i] - 1)
	sum2 = 2 * x + 3 * (m - x)
	if sum1 - sum2 > res1 - res2 or (sum1 - sum2 == res1 - res2 and sum1 > res1):
		(res1, res2) = (sum1, sum2)
print(res1, end='')
print(':', end='')
print(res2)


(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='')


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()


import bisect
n = int(input())
L1 = []
L2 = []
parse = input().split()
for i in parse:
	L1.append(int(i))
L1.sort(reverse=False)
m = int(input())
parse = input().split()
for i in parse:
	L2.append(int(i))
L2.sort(reverse=False)
Adv1 = 0
Adv2 = 0
maxAdv = -2000000000.0
L1.append(2000000000.0 + 1)
for i in range(n + 1):
	d = L1[i] - 1
	n1 = n - i
	n2 = m - bisect.bisect_right(L2, d)
	adv = n1 - n2
	if maxAdv < adv:
		maxAdv = adv
		Adv1 = n1
		Adv2 = n2
	elif maxAdv == adv and Adv1 < n1:
		Adv1 = n1
		Adv2 = n2
print(3 * Adv1 + 2 * (n - Adv1), ':', 3 * Adv2 + 2 * (m - Adv2), sep='')


(n, ans, x1, x2) = (int(input()), 0, 0, 0)
num1 = list(sorted(map(int, input().split())))
(m, p2) = (int(input()), 0)
num2 = list(sorted(map(int, input().split())))
(ans, x1, x2) = ((n - m) * 2, n * 2, m * 2)
for i in range(n):
	while p2 < m and num2[p2] < num1[i]:
		p2 += 1
	(y1, y2) = (i * 2 + (n - i) * 3, p2 * 2 + (m - p2) * 3)
	if y1 - y2 > ans or (y1 - y2 == ans and y1 > x1):
		(ans, x1, x2) = (y1 - y2, y1, y2)
print('%d:%d' % (x1, x2))


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 os, sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = sorted(map(int, input().split()))
	m = int(input())
	b = sorted(map(int, input().split()))
	z = [0] + sorted(a + b)
	(i, j) = (0, 0)
	ans = [-10 ** 10, 0]
	for ptr in z:
		while i != n and a[i] <= ptr:
			i += 1
		while j != m and b[j] <= ptr:
			j += 1
		kk = i * 2 + (n - i) * 3
		kk1 = j * 2 + (m - j) * 3
		if kk - kk1 > ans[0] - ans[1]:
			ans = [kk, kk1]
	print('{}:{}'.format(ans[0], ans[1]))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


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))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	n = int(inp())
	a = sorted(lis())
	m = int(inp())
	b = sorted(lis())
	ans = [n * 3, m * 3]
	for i in range(n):
		if i < n - 1 and a[i] == a[i + 1]:
			continue
		ind = br(b, a[i])
		if ind < m and b[ind] == a[i]:
			curr1 = (i + 1) * 2 + (n - (i + 1)) * 3
			curr2 = (ind + 1) * 2 + (m - (ind + 1)) * 3
			if curr1 - curr2 > ans[0] - ans[1]:
				ans = [curr1, curr2]
		else:
			curr1 = (i + 1) * 2 + (n - (i + 1)) * 3
			curr2 = ind * 2 + (m - ind) * 3
			if curr1 - curr2 > ans[0] - ans[1] or (curr1 - curr2 == ans[0] - ans[1] and curr1 > ans[0]):
				ans = [curr1, curr2]
	for i in range(m):
		if i < m - 1 and b[i] == b[i + 1]:
			continue
		ind = br(a, b[i])
		if ind < n and a[ind] == b[i]:
			curr1 = (i + 1) * 2 + (m - (i + 1)) * 3
			curr2 = (ind + 1) * 2 + (n - (ind + 1)) * 3
			if curr2 - curr1 > ans[0] - ans[1]:
				ans = [curr2, curr1]
		else:
			curr1 = (i + 1) * 2 + (m - (i + 1)) * 3
			curr2 = ind * 2 + (n - ind) * 3
			if curr2 - curr1 > ans[0] - ans[1] or (curr2 - curr1 == ans[0] - ans[1] and curr2 > ans[0]):
				ans = [curr2, curr1]
	print(str(ans[0]) + ':' + str(ans[1]))
testcase(1)


from bisect import bisect_right
from math import inf
n = int(input())
a = sorted([int(x) for x in input().split()])
m = int(input())
b = sorted([int(x) for x in input().split()])
p = -inf
tt = []
for i in sorted(a + b + [0]):
	x = n - bisect_right(a, i)
	y = m - bisect_right(b, i)
	if x - y > p:
		p = x - y
		tt = [x, y]
print(*[n * 2 + tt[0], m * 2 + tt[1]], sep=':')