#include <bits/stdc++.h>
using namespace std;
long long pot(long long b, long long e) {
  long long res = 1;
  b %= (1000000000 + 7);
  while (e) {
    if (e & 1) {
      res = (res * b) % (1000000000 + 7);
    }
    b = (b * b) % (1000000000 + 7);
    e /= 2;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> vet1(n);
  for (auto& p : vet1) {
    cin >> p;
  }
  long long m;
  cin >> m;
  vector<long long> vet2(m);
  for (auto& p : vet2) {
    cin >> p;
  }
  long long p1 = 0, p2 = 0;
  sort(vet1.begin(), vet1.end());
  sort(vet2.begin(), vet2.end());
  pair<long long, pair<long long, long long> > res{-0x3f3f3f3f3f3f3f3fLL,
                                                   {-1, -1}};
  vet1.push_back(0x3f3f3f3f3f3f3f3fLL);
  vet2.push_back(0x3f3f3f3f3f3f3f3fLL);
  while (p1 <= n) {
    if (p2 <= m) {
      while (p2 < m && vet2[p2] < vet1[p1]) {
        long long a = (n - p1) * 3 + p1 * 2;
        long long b = (m - p2) * 3 + p2 * 2;
        res = max(res, {a - b, {a, b}});
        ++p2;
        while (p2 + 1 < m && vet2[p2] == vet2[p2 - 1]) {
          ++p2;
        }
      }
    }
    long long a = (n - p1) * 3 + p1 * 2;
    long long b = (m - p2) * 3 + p2 * 2;
    res = max(res, {a - b, {a, b}});
    ++p1;
    while (p1 + 1 < n && vet1[p1] == vet1[p1 - 1]) {
      ++p1;
    }
  }
  long long a = (n - p1) * 3 + p1 * 2;
  long long b = (m - p2) * 3 + p2 * 2;
  res = max(res, {a - b, {a, b}});
  cout << res.second.first << ":" << res.second.second << "\n";
  return 0;
}
