#include <bits/stdc++.h>
using namespace std;
int n, m, z, x, g1, g2, d1, d2, jav;
vector<pair<pair<int, int>, int> > v;
int main() {
  cin >> n;
  v.push_back({{2000000009, 2000000009}, 0});
  for (int i = 0; i < n; i++) {
    cin >> x;
    v.push_back({{x, 0}, 0});
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> x;
    v.push_back({{x, 1}, 0});
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  z = n + m;
  for (int i = 1; i <= z; i++) {
    if (v[i].first.second == 0) {
      x = 1;
      d1++;
    } else {
      x = -1;
      d2++;
    }
    v[i].second = v[i - 1].second + x;
    if (jav <= v[i].second) {
      jav = v[i].second;
      g1 = d1;
      g2 = d2;
    }
  }
  cout << g1 + n * 2 << ':' << g2 + m * 2;
  return 0;
}
