#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, x;
  vector<pair<int, int> > A;
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) {
    scanf("%d", &x);
    A.push_back(make_pair(x, 0));
  }
  scanf("%d", &m);
  for (int i = 0; i < (m); ++i) {
    scanf("%d", &x);
    A.push_back(make_pair(x, 1));
  }
  A.push_back(make_pair(1e9, 2));
  sort(A.begin(), A.end());
  int i = 0, S[2] = {0, 0}, d = -2e9, ma = 0, mb = 0;
  while (i < n + m) {
    int C[2] = {0, 0};
    while (A[i].first == A[i + 1].first) {
      ++C[A[i].second];
      ++i;
    }
    ++C[A[i].second];
    a = 2 * S[0] + 3 * (n - S[0]);
    b = 2 * S[1] + 3 * (m - S[1]);
    S[0] += C[0];
    S[1] += C[1];
    if ((a - b) > d || ((a - b == d) && a > ma)) {
      d = a - b;
      ma = a;
      mb = b;
    }
    ++i;
  }
  a = 2 * S[0] + 3 * (n - S[0]);
  b = 2 * S[1] + 3 * (m - S[1]);
  if ((a - b) > d || ((a - b == d) && a > ma)) {
    d = a - b;
    ma = a;
    mb = b;
  }
  printf("%d:%d\n", ma, mb);
  return 0;
}
