#include <bits/stdc++.h>
using namespace std;
long long i, k, j, l, s, t, a[223556], b[223456], c, cc, n, m, d, e, f, ff;
string p, r, q, rr;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
  }
  d = 2 * n;
  sort(a, a + n);
  cin >> m;
  for (i = 0; i < m; i++) {
    scanf("%I64d", &b[i]);
  }
  e = 2 * m;
  s = d - e;
  sort(b, b + m);
  l = max(a[n - 1], b[m - 1]);
  c = n - 1;
  cc = m - 1;
  while (l >= 0) {
    if (s <= (2 * n + k - 2 * m - t)) {
      f = 2 * n + k;
      ff = 2 * m + t;
      s = f - ff;
    }
    while (l == a[c] && c >= 0) {
      c--;
      k++;
    }
    while (l == b[cc] && cc >= 0) {
      cc--;
      t++;
    }
    if (c >= 0 && cc >= 0) {
      l = max(a[c], b[cc]);
    }
    if (c < 0 && cc >= 0) l = b[cc];
    if (cc < 0 && c >= 0) l = a[c];
    if (c == -1 && cc == -1 && l == 0) l = -1;
    if (c == -1 && cc == -1 && l > 0) l = 0;
  }
  cout << f << ':' << ff;
}
