#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> c;
  vector<int> a(n);
  for (int& x : a) cin >> x;
  sort(a.begin(), a.end());
  int m;
  cin >> m;
  vector<int> b(m);
  for (int& x : b) cin >> x;
  sort(b.begin(), b.end());
  c.reserve(n + m);
  c.insert(c.end(), a.begin(), a.end());
  c.insert(c.end(), b.begin(), b.end());
  c.push_back(0);
  c.push_back(2e9 + 1);
  long long ans = -10000000000000000LL;
  int fi = -1, se = -1;
  for (int& x : c) {
    int lo, hi, res, ptsa, ptsb;
    lo = 0, hi = n - 1, res = -1;
    while (lo <= hi) {
      int mid = lo + hi >> 1;
      if (a[mid] <= x)
        res = mid, lo = mid + 1;
      else
        hi = mid - 1;
    }
    ptsa = (res + 1) * 2 + (n - 1 - res) * 3;
    lo = 0, hi = m - 1, res = -1;
    while (lo <= hi) {
      int mid = lo + hi >> 1;
      if (b[mid] <= x)
        res = mid, lo = mid + 1;
      else
        hi = mid - 1;
    }
    ptsb = (res + 1) * 2 + (m - 1 - res) * 3;
    if (ptsa - ptsb > ans) {
      ans = ptsa - ptsb;
      fi = ptsa, se = ptsb;
    } else if (ptsa - ptsb == ans && ptsa > fi) {
      fi = ptsa, se = ptsb;
    }
  }
  cout << fi << ':' << se;
}
