#include <bits/stdc++.h>
using namespace std;
struct less_key {
  bool operator()(const pair<uint32_t, char>& p1,
                  const pair<uint32_t, char>& p2) {
    return p1.first < p2.first ||
           (p1.first == p2.first && p1.second < p2.second);
  }
};
int32_t n, m;
map<int32_t, pair<int32_t, int32_t> > a;
int main() {
  cin >> n;
  for (uint32_t i = 0; i < n; i++) {
    uint32_t d;
    cin >> d;
    auto it = a.find(d);
    if (it == a.end()) {
      a.insert(make_pair(d, make_pair(1, 0)));
    } else {
      it->second.first++;
    }
  }
  cin >> m;
  for (uint32_t i = 0; i < m; i++) {
    uint32_t d;
    cin >> d;
    auto it = a.find(d);
    if (it == a.end()) {
      a.insert(make_pair(d, make_pair(0, 1)));
    } else {
      it->second.second++;
    }
  }
  int32_t score_a = n * 3;
  int32_t score_b = m * 3;
  int32_t max_a = score_a;
  int32_t max_b = score_b;
  int32_t max_dif = score_a - score_b;
  for (auto it = a.begin(); it != a.end(); it++) {
    score_a -= it->second.first;
    score_b -= it->second.second;
    if (score_a - score_b > max_dif) {
      max_a = score_a;
      max_b = score_b;
      max_dif = score_a - score_b;
    }
  }
  cout << max_a << ":" << max_b;
  return 0;
}
