#include <bits/stdc++.h>
using namespace std;
int n, m, suma, sumb, diff = -INT_MIN;
vector<int> a, b;
int main() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  b.resize(m);
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  a.push_back(INT_MAX);
  b.push_back(INT_MAX);
  for (int i = 0; i <= n; i++) {
    int s = -1, e = m;
    while (e - s > 1) {
      int mid = (s + e) / 2;
      if (b[mid] >= a[i])
        e = mid;
      else
        s = mid;
    }
    int ta = 2 * i + 3 * (n - i);
    int tb = 2 * e + 3 * (m - e);
    if (ta - tb > diff) {
      diff = ta - tb;
      suma = ta;
      sumb = tb;
    }
  }
  cout << suma << ":" << sumb << endl;
  return 0;
}
