#include <bits/stdc++.h>
using namespace std;
int n, m;
long long a[200005], b[200005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  int j = m;
  long long ab = n, ba = m, x = 0, y = 0;
  for (int i = n; 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;
  printf("%lld:%lld", n * 2 + ab, m * 2 + ba);
  return 0;
}
