#include <bits/stdc++.h>
using namespace std;
long long a[200010], b[200010], c[400010];
int t, n, m;
int main() {
  scanf("%d", &n);
  int num = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    c[num++] = a[i];
  }
  sort(a + 1, a + n + 1);
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%I64d", &b[i]);
    c[num++] = b[i];
  }
  sort(b + 1, b + m + 1);
  sort(c + 1, c + num);
  long long ans = (long long)(-1e10);
  long long x, y;
  if (ans < n * 2 - m * 2) {
    x = (long long)n * 2;
    y = (long long)m * 2;
    ans = x - y;
  }
  for (int i = num - 1; i >= 0; i--) {
    int tmp1 = upper_bound(a + 1, a + n + 1, c[i]) - a - 1;
    int tmp2 = upper_bound(b + 1, b + m + 1, c[i]) - b - 1;
    if (ans <= (long long)tmp1 * 2 + (long long)(n - tmp1) * 3 -
                   (long long)tmp2 * 2 - (long long)(m - tmp2) * 3) {
      x = (long long)tmp1 * 2 + (long long)(n - tmp1) * 3;
      y = (long long)tmp2 * 2 + (long long)(m - tmp2) * 3;
      ans = x - y;
    }
  }
  cout << x << ":" << y << endl;
  return 0;
}
