#include <bits/stdc++.h>
using namespace std;
template <typename T>
string NumberToString(T Number) {
  ostringstream ss;
  ss << Number;
  return ss.str();
}
void solveC() {
  int n, m;
  cin >> n;
  vector<pair<int, bool> > v;
  int ba = 0, bb = 0;
  for (int i = 0; i < int(n); i++) {
    int p;
    scanf("%d", &p);
    v.push_back(make_pair(p, true));
    ba += 1;
  }
  cin >> m;
  for (int i = 0; i < int(m); i++) {
    int p;
    scanf("%d", &p);
    v.push_back(make_pair(p, false));
    bb += 1;
  }
  sort(v.begin(), v.end());
  int bestD = 3 * ba - 3 * bb;
  int s1 = 3 * ba, s2 = 3 * bb;
  int curA = 0, curB = 0;
  for (int i = 0; i < int(v.size()); i++) {
    if (v[i].second)
      curA++;
    else
      curB++;
    while (i + 1 < v.size() && v[i + 1].first == v[i].first) {
      i++;
      if (v[i].second)
        curA++;
      else
        curB++;
    }
    int nd = curA * 2 + (ba - curA) * 3 - (curB * 2 + (bb - curB) * 3);
    if (nd > bestD) {
      bestD = nd;
      s1 = curA * 2 + (ba - curA) * 3;
      s2 = curB * 2 + (bb - curB) * 3;
    }
  }
  cout << s1 << ":" << s2 << endl;
}
int main() { solveC(); }
