#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a, b;
  int n, m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    a.push_back(tmp);
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    int tmp;
    cin >> tmp;
    b.push_back(tmp);
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  int a3 = 0, b3 = 0;
  for (int i = a.size() - 1; i >= 0; i--) {
    int l = 0, r = m;
    while (l < r) {
      int mid = (l + r) / 2;
      if (b[mid] >= a[i]) {
        r = mid;
      } else
        l = mid + 1;
    }
    if ((n - i) - (m - l) >= (a3 - b3)) {
      a3 = n - i;
      b3 = m - l;
    }
  }
  cout << a3 * 3 + (n - a3) * 2 << ":" << b3 * 3 + (m - b3) * 2 << endl;
  return 0;
}
