#include <bits/stdc++.h>
using namespace std;
int const MAX = 200005;
long long a[MAX], b[MAX], n, m;
int main() {
  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);
  int j = m - 1;
  long long x = 0, y = 0, ab = n, ba = m;
  for (int i = n - 1; i >= 0; i--) {
    while (j >= 0 && a[i] <= b[j]) {
      j--;
      y++;
    }
    x++;
    if (x - y >= ab - ba) {
      ab = x;
      ba = y;
    }
  }
  if (ab < ba) ab = ba = 0;
  cout << n * 2 + ab << ":" << m * 2 + ba << endl;
}
