#include <bits/stdc++.h>
using namespace std;
long long a[200005], b[200005];
int main() {
  long long i, j, n, m, ans, mid, pa, pb, am, bm;
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a + 1, a + n + 1);
  scanf("%lld", &m);
  for (i = 1; i <= m; i++) {
    scanf("%lld", &b[i]);
  }
  sort(b + 1, b + m + 1);
  mid = min(a[1], b[1]) - 1;
  am = bm = pa = pb = 0;
  ans = -1000000000000;
  for (i = 1, j = 1;;) {
    if (i == n + 1 && j == m + 1) break;
    while (i <= n && a[i] <= mid) {
      i++;
    }
    while (j <= m && b[j] <= mid) {
      j++;
    }
    pa = (i - 1) * 2 + (n - i + 1) * 3;
    pb = (j - 1) * 2 + (m - j + 1) * 3;
    if ((pa - pb) > ans) {
      ans = pa - pb;
      am = pa;
      bm = pb;
    } else if (pa - pb == ans && pa > am) {
      ans = pa - pb;
      am = pa;
      bm = pb;
    }
    if (i <= n && j <= m)
      mid = min(a[i], b[j]);
    else if (i <= n)
      mid = a[i];
    else if (j <= m)
      mid = b[j];
  }
  printf("%lld:%lld\n", am, bm);
  return 0;
}
