#include <bits/stdc++.h>
using namespace std;
long long a[200000], b[200000];
int main() {
  long int n, i, j, m;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  for (i = 0; i < m; i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + m);
  long long pa = 2 * n, pb = 2 * m, maxa = pa, maxb = pb;
  i = n - 1, j = m - 1;
  while (i >= 0) {
    while (a[i] == a[i - 1] && i > 0) {
      i--;
      pa++;
    }
    while (b[j] >= a[i] && j >= 0) {
      j--;
      pb++;
    }
    pa++;
    if (pa - pb >= maxa - maxb && pa > maxa) {
      maxa = pa;
      maxb = pb;
    }
    i--;
  }
  cout << maxa << ":" << maxb;
}
