#include <bits/stdc++.h>
using namespace std;
template <typename T>
T sqr(T x) {
  return x * x;
}
template <typename T>
T abs(T x) {
  return x < 0 ? -x : x;
}
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
const int MAXN = 4e5 + 10;
int n, m, nm;
pair<int, int> a[MAXN];
int coln[MAXN], colm[MAXN];
int ansn = -1000000007, ansm = 1000000007;
int main() {
  ios_base ::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    a[i] = make_pair(x, 0);
  }
  cin >> m;
  nm = n + m;
  for (int i = n + 1; i <= nm; i++) {
    int x;
    cin >> x;
    a[i] = make_pair(x, 1);
  }
  sort(a + 1, a + nm + 1);
  coln[nm] = a[nm].second == 0;
  colm[nm] = a[nm].second == 1;
  for (int i = nm - 1; i; i--) {
    coln[i] = coln[i + 1] + (a[i].second == 0);
    colm[i] = colm[i + 1] + (a[i].second == 1);
  }
  coln[0] = coln[1];
  colm[0] = colm[1];
  for (int i = 0; i <= nm + 1; i++)
    if (a[i].first != a[i - 1].first)
      if (ansm - ansn >
          (colm[i] * 3 + (m - colm[i]) * 2) - (coln[i] * 3 + (n - coln[i]) * 2))
        ansm = (colm[i] * 3 + (m - colm[i]) * 2),
        ansn = (coln[i] * 3 + (n - coln[i]) * 2);
  cout << ansn << ':' << ansm;
}
