#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  vector<pair<int, int> > ar;
  cin >> n;
  for (int ctr1 = 0; ctr1 < n; ctr1++) {
    int a;
    cin >> a;
    ar.push_back(make_pair(a, 0));
  }
  cin >> m;
  for (int ctr1 = 0; ctr1 < m; ctr1++) {
    int a;
    cin >> a;
    ar.push_back(make_pair(a, 1));
  }
  sort(ar.begin(), ar.end());
  long long f = 0, s = 0;
  long long rf = 3 * n, rs = 3 * m;
  long long r = 3 * n - 3 * m;
  if (2 * n - 2 * m > r) {
    r = 2 * n - 2 * m;
    rf = 2 * n;
    rs = 2 * m;
  }
  for (int ctr1 = 0; ctr1 < ar.size() - 1; ctr1++) {
    if (ar[ctr1].second == 0)
      f++;
    else
      s++;
    if (ar[ctr1].first != ar[ctr1 + 1].first) {
      if (2 * f + 3 * (n - f) - 2 * s - 3 * (m - s) > r) {
        r = 2 * f + 3 * (n - f) - 2 * s - 3 * (m - s);
        rf = 2 * f + 3 * (n - f);
        rs = 2 * s + 3 * (m - s);
      }
      if (2 * f + 3 * (n - f) - 2 * s - 3 * (m - s) == r) {
        if (2 * f + 3 * (n - f) > rf) {
          rf = 2 * f + 3 * (n - f);
          rs = 2 * s + 3 * (m - s);
        }
      }
    }
  }
  cout << rf << ":" << rs << endl;
  return 0;
}
