#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> a;
int main() {
  long long n, m, d;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    a.push_back(make_pair(k, 1));
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    int k;
    cin >> k;
    a.push_back(make_pair(k, 2));
  }
  sort(a.begin(), a.end());
  long long ans1 = n * 3;
  long long ans2 = m * 3;
  d = ans1 - ans2;
  long long l = 0, r = 0;
  for (int i = 0; i < n + m; i++) {
    if (a[i].second == 1)
      l++;
    else
      r++;
    if (l * 2 + (n - l) * 3 - (r)*2 - (m - r) * 3 > d) {
      d = l * 2 + (n - l) * 3 - (r)*2 - (m - r) * 3;
      ans1 = l * 2 + (n - l) * 3;
      ans2 = (r)*2 + (m - r) * 3;
    }
  }
  cout << ans1 << ':' << ans2;
}
