#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[400000], b[400000], c, d, i, j, n, m, l, r, max_d = -1 * 1e9, x,
                                                          y, last;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i + 1];
  }
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> b[i + 1];
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  a[0] = a[1] - 1;
  a[n + 1] = a[n] + 1;
  b[0] = b[1] - 1;
  b[m + 1] = b[m] + 1;
  j = 0;
  last = a[0];
  i = 0;
  while (i <= n + 1) {
    last = a[i];
    while (j < m && b[j + 1] < a[i]) {
      j++;
    }
    if (i == 0) {
      c = n;
    } else {
      c = n - i + 1;
    }
    c = (c * 3) + ((n - c) * 2);
    d = (j * 2) + ((m - j) * 3);
    if (max_d < (c - d) || (max_d == (c - d) && c > x)) {
      max_d = c - d;
      x = c;
      y = d;
    }
    while (i <= n + 1 && last == a[i]) i++;
  }
  j = 0;
  last = b[0];
  i = 0;
  while (i <= m + 1) {
    last = b[i];
    while (j < n && a[j + 1] < b[i]) {
      j++;
    }
    if (i == 0) {
      c = m;
    } else {
      c = m - i + 1;
    }
    c = (c * 3) + ((m - c) * 2);
    d = (j * 2) + ((n - j) * 3);
    if (max_d < (d - c) || (max_d == (d - c) && d > x)) {
      max_d = d - c;
      x = d;
      y = c;
    }
    while (i <= m + 1 && last == b[i]) i++;
  }
  cout << x << ":" << y << endl;
  return 0;
}
