#include <bits/stdc++.h>
using namespace std;
struct vahag {
  long long val, ind;
};
bool operator<(const vahag& a, const vahag& b) { return a.val < b.val; }
long long n, m, i, j, k, q, s, v, w, ans, t, diff = -1e16, t1, t2;
vahag a[400005];
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    t++;
    a[t].val = x;
    a[t].ind = 1;
  }
  cin >> m;
  for (i = 1; i <= m; i++) {
    long long x;
    cin >> x;
    t++;
    a[t].val = x;
    a[t].ind = 2;
  }
  sort(a + 1, a + 1 + n + m);
  for (i = 1; i <= n + m; i++) {
    long long p1 = 0, p2 = 0;
    if (a[i].ind == 1)
      p1++;
    else
      p2++;
    while (i + 1 <= n + m && a[i].val == a[i + 1].val) {
      if (a[i + 1].ind == 1)
        p1++;
      else
        p2++;
      i++;
    }
    if (s * 2 + (n - s) * 3 - q * 2 - (m - q) * 3 > diff ||
        ((s * 2 + (n - s) * 3 - q * 2 - (m - q) * 3 == diff) &&
         s * 2 + (n - s) * 3 > t1)) {
      t1 = s * 2 + (n - s) * 3;
      t2 = q * 2 + (m - q) * 3;
      diff = s * 2 + (n - s) * 3 - q * 2 - (m - q) * 3;
    }
    s += p1;
    q += p2;
  }
  if (n * 2 - m * 2 > diff || (n * 2 - m * 2 == diff && 2 * n > t1)) {
    t1 = 2 * n;
    t2 = 2 * m;
  }
  cout << t1 << ":" << t2 << endl;
  return 0;
}
