#include <bits/stdc++.h>
using namespace std;
class goal {
 public:
  long long int v;
  bool b;
  goal(long long int i, bool bo) {
    v = i;
    b = bo;
  }
};
class D {
 public:
  long long int d;
  long long int grm, grn;
  D(long long int i) {
    d = i;
    grm = 0;
    grn = 0;
  }
};
struct eqstr {
  bool operator()(const goal &a, const goal &b) const { return a.v < b.v; }
};
vector<D> dvals;
vector<goal> mn;
int main() {
  long long int M, N, i, var, frm, frn, max, lvar, mc = 0, nc = 0, lcount = 0;
  ;
  goal local(0, 0);
  cin >> M;
  for (i = 0; i < M; i++) {
    cin >> var;
    local.v = var;
    local.b = 0;
    mn.push_back(local);
  }
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> var;
    local.v = var;
    local.b = 1;
    mn.push_back(local);
  }
  frm = 2 * M;
  frn = 2 * N;
  max = frm - frn;
  lvar = max;
  sort(mn.begin(), mn.end(), eqstr());
  for (i = M + N - 2; i >= 0; i--) {
    if (mn[i + 1].v != mn[i].v) {
      if (!(mn[i + 1].b)) {
        lvar = lvar + 1 + lcount;
        mc++;
      } else {
        lvar = lvar - 1 + lcount;
        nc++;
      }
      lcount = 0;
      if (max <= lvar) {
        max = lvar;
        frm = 3 * mc + 2 * (M - mc);
        frn = 3 * nc + 2 * (N - nc);
      }
    } else {
      if (mn[i + 1].b) {
        lcount--;
        nc++;
      } else {
        lcount++;
        mc++;
      }
    }
  }
  if (max <= (3 * (M - N))) {
    cout << 3 * M << ":" << 3 * N << endl;
    return 0;
  }
  cout << frm << ":" << frn << endl;
  return 0;
}
