#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:3677720")
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  map<int, int> aa, bb;
  set<int> dist;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    aa[a[i]]++;
    dist.insert(a[i]);
  }
  int m;
  scanf("%d", &m);
  vector<int> b(m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &b[i]);
    bb[b[i]]++;
    dist.insert(b[i]);
  }
  int ca = n, cb = m;
  long long sa, sb;
  pair<long long, long long> ans;
  long long d = (long long)-1e18;
  for (auto it = dist.begin(); it != dist.end(); it++) {
    sa = (long long)ca * 3 + (long long)(n - ca) * 2;
    sb = (long long)cb * 3 + (long long)(m - cb) * 2;
    long long t = sa - sb;
    if (t > d) {
      d = t;
      ans.first = sa;
      ans.second = sb;
    }
    cb -= bb[*it];
    ca -= aa[*it];
  }
  sa = (long long)n * 2;
  sb = (long long)m * 2;
  if (sa - sb > d) {
    ans.first = sa;
    ans.second = sb;
  }
  cout << ans.first << ":" << ans.second;
  return 0;
}
