#include <bits/stdc++.h>
using namespace std;
bool checkBit(long long int n, long long int i) { return (n & (1LL << i)); }
long long int setBit(long long int n, long long int i) {
  return (n | (1LL << i));
}
long long int resetBit(long long int n, long long int i) {
  return (n & (~(1LL << i)));
}
set<int> all;
map<int, int> ma, mb;
int suf_a[200003], pref_a[200003], suf_b[200003], pref_b[200003];
void solve() {
  memset(suf_a, 0, sizeof(suf_a));
  memset(suf_b, 0, sizeof(suf_b));
  memset(pref_a, 0, sizeof(pref_a));
  memset(pref_b, 0, sizeof(pref_b));
  ma.clear();
  mb.clear();
  all.clear();
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    all.insert(x);
    ma[x]++;
  }
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    all.insert(x);
    mb[x]++;
  }
  vector<int> v;
  v.push_back(0);
  for (auto x : all) {
    v.push_back(x);
  }
  int sz = v.size();
  for (int i = 1; i < sz; i++) {
    pref_a[i] += pref_a[i - 1] + ma[v[i]];
    pref_b[i] += pref_b[i - 1] + mb[v[i]];
  }
  for (int i = sz - 1; i > 0; i--) {
    suf_a[i] += suf_a[i + 1] + ma[v[i]];
    suf_b[i] += suf_b[i + 1] + mb[v[i]];
  }
  pair<int, int> ans = {0, 0};
  int mx = -1e9;
  for (int i = 0; i < sz; i++) {
    int cnta = 2 * pref_a[i];
    cnta += 3 * suf_a[i + 1];
    int cntb = 2 * pref_b[i];
    cntb += 3 * suf_b[i + 1];
    int diff = cnta - cntb;
    if (diff > mx) {
      mx = diff;
      ans = {cnta, cntb};
    } else if (diff == mx and ans.first < cnta) {
      ans = {cnta, cntb};
    }
  }
  cout << ans.first << ":" << ans.second << "\n";
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
