#include <bits/stdc++.h>
template <typename T>
T in() {
  char ch;
  T n = 0;
  bool ng = false;
  while (1) {
    ch = getchar();
    if (ch == '-') {
      ng = true;
      ch = getchar();
      break;
    }
    if (ch >= '0' && ch <= '9') break;
  }
  while (1) {
    n = n * 10 + (ch - '0');
    ch = getchar();
    if (ch < '0' || ch > '9') break;
  }
  return (ng ? -n : n);
}
using namespace std;
vector<long long int> a, b, c;
int main() {
  long long int n, m;
  cin >> n;
  c.push_back(0);
  for (int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    a.push_back(x);
    c.push_back(x);
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    long long int x;
    cin >> x;
    b.push_back(x);
    c.push_back(x);
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  long long int ans1 = -1, ans2 = -1, diff = -(1 << 28);
  for (int i = 0; i < c.size(); i++) {
    long long int koto = upper_bound(a.begin(), a.end(), c[i]) - a.begin();
    long long int koto1 = upper_bound(b.begin(), b.end(), c[i]) - b.begin();
    long long int k = koto * 2LL + (n - koto) * 3LL;
    long long int kk = koto1 * 2LL + (m - koto1) * 3LL;
    long long int df = k - kk;
    if (df > diff) {
      ans1 = k, ans2 = kk;
      diff = df;
    } else if (diff == df) {
      if (ans1 < k) {
        ans1 = k, ans2 = kk;
      }
    }
  }
  cout << ans1 << ":" << ans2 << endl;
  return 0;
}
