#include <bits/stdc++.h>
using namespace std;
int find(int val, vector<int>* arr, int l, int r) {
  if (l >= r - 1) {
    if (arr->at(r) <= val) return arr->at(r);
    return arr->at(l);
  }
  int mid = (l + r) / 2;
  if (arr->at(mid) > val) return find(val, arr, l, mid);
  if (arr->at(mid) < val) return find(val, arr, mid, r);
  return arr->at(mid);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int aa[n + 1];
  for (int i = 1; i <= n; i++) cin >> aa[i];
  sort(aa + 1, aa + n + 1);
  aa[0] = -1;
  int m;
  cin >> m;
  int ba[m + 1];
  for (int i = 1; i <= m; i++) cin >> ba[i];
  sort(ba + 1, ba + m + 1);
  ba[0] = -1;
  vector<int> as = {0}, bs = {0};
  map<int, long long> am, bm;
  int cnta = 0;
  for (int i = 1; i <= n; i++) {
    if (aa[i] > aa[i - 1]) {
      as.push_back(aa[i]);
      am[aa[i - 1]] = cnta;
    }
    cnta++;
  }
  am[aa[n]] = cnta;
  int cntb = 0;
  for (int i = 1; i <= m; i++) {
    if (ba[i] > ba[i - 1]) {
      bs.push_back(ba[i]);
      bm[ba[i - 1]] = cntb;
    }
    cntb++;
  }
  bm[ba[m]] = cntb;
  long long a = 2 * n, b = 2 * m;
  for (int i = 1; i < as.size(); i++) {
    int bt = find(as[i] - 1, &bs, 0, bs.size() - 1);
    long long ai = am[as[i - 1]] * 2 + (long long)(n - am[as[i - 1]]) * 3;
    long long bi = bm[bt] * 2 + (long long)(m - bm[bt]) * 3;
    if (ai - bi > a - b || (ai - bi == a - b && ai > a)) a = ai, b = bi;
  }
  cout << a << ":" << b;
  return 0;
}
