#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  int n, m;
  cin >> n;
  std::vector<int> aa(n);
  std::vector<std::pair<int, int> > al;
  int mod1 = 0, mod2 = 0;
  int nn = n;
  for (int i = 0; i < nn; i++) {
    cin >> aa[i];
    al.push_back(make_pair(aa[i], -1));
  }
  cin >> m;
  int mm = m;
  std::vector<int> b(m);
  for (int i = 0; i < mm; i++) {
    cin >> b[i];
    al.push_back(make_pair(b[i], 1));
  }
  int ans = 3 * (n - m);
  int cura = 3 * n;
  int cpans = cura;
  int cc = ans;
  sort((al).begin(), (al).end());
  auto a = al.begin();
  while (a != al.end()) {
    int cur = (*a).first;
    int cpa = 0;
    if ((*a).second < 0) cpa = -1;
    int cp = (*a).second;
    a++;
    while ((a != al.end()) && (cur == (*a).first)) {
      cp += (*a).second;
      if ((*a).second < 0) cpa--;
      a++;
    }
    cc += cp;
    cura += cpa;
    if (cc > ans) {
      ans = cc;
      cpans = cura;
    }
  }
  cout << cpans << ":" << cpans - ans;
}
