#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[212345], b[212345];
long long A, B;
void make(long long an, long long bn) {
  if (A - B < an - bn) {
    A = an;
    B = bn;
  }
  if (A - B == an - bn && A < an) {
    A = an;
    B = bn;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + m);
  A = 3 * n, B = 3 * m;
  make(3 * n, 3 * m);
  make(2 * n, 2 * m);
  int d = 0;
  int r = 0;
  for (int l = 0; l < n; l++) {
    long long d = a[l] - 1;
    while (r < m && b[r] <= d) r++;
    long long L = l, R = r;
    make(L * 2 + (n - L) * 3, R * 2 + (m - R) * 3);
  }
  cout << A << ':' << B;
}
