#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e15;
const int N = 200100;
long long A[N], B[N], n, m;
long long t1, t2, na, nb, aa, bb;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> A[i];
  cin >> m;
  for (int i = 0; i < m; ++i) cin >> B[i];
  sort(A, A + n);
  sort(B, B + m);
  aa = na = n * 3;
  bb = nb = m * 3;
  A[n] = B[m] = INF;
  t1 = t2 = 0;
  while (t1 < n || t2 < m) {
    if (A[t1] < B[t2]) {
      t1++;
      na--;
    } else if (A[t1] > B[t2]) {
      t2++;
      nb--;
      if (na - nb > aa - bb) {
        aa = na;
        bb = nb;
      }
    } else {
      t1++, t2++;
      na--, nb--;
    }
  }
  cout << aa << ":" << bb << endl;
  return 0;
}
