#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y) {
  unsigned long long int res = 1;
  x = x % 1000000007;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
long long int bst(long long int a[], long long int item, long long int index,
                  long long int n) {
  long long int b = index, e = n, mid;
  mid = (b + e) / 2;
  while (b <= e && a[mid] != item) {
    if (a[mid] < item)
      b = mid + 1;
    else
      e = mid - 1;
    mid = (b + e) / 2;
  }
  return mid;
}
long long int max3(long long int x, long long int y, long long int z) {
  return max(max(x, y), z);
}
long long int min3(long long int x, long long int y, long long int z) {
  return min(min(x, y), z);
}
string cir_shift(string s) {
  string s1;
  long long int len;
  len = s.size();
  s1 = s.substr(1, len - 1);
  s1.push_back(s[0]);
  return s1;
}
template <typename Type>
void swap1(Type &a, Type &b) {
  Type temp;
  temp = a;
  a = b;
  b = temp;
}
long long int a[200001], b[200001], c[200001];
long long int bst1(long long int item, long long int index, long long int n) {
  long long int bb = index, e = n, mid;
  mid = (bb + e) / 2;
  while (bb <= e && b[mid] != item) {
    if (b[mid] < item)
      bb = mid + 1;
    else
      e = mid - 1;
    mid = (bb + e) / 2;
  }
  if (b[mid] == item)
    return c[mid];
  else
    return mid;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  long long int n, m, i, j, v1, v2, t1, t2, val = -1000000000000000001, ind;
  cin >> n;
  for (i = 0; i <= n - 1; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  cin >> m;
  for (i = 0; i <= m - 1; i++) {
    cin >> b[i];
  }
  sort(b, b + m);
  for (i = m - 1; i >= 0;) {
    j = i - 1;
    c[i] = i;
    while (j >= 0 && b[i] == b[j]) {
      c[j] = i;
      j--;
    }
    if (j < 0) {
      break;
    } else
      i = j;
  }
  for (i = 0; i <= n - 1; i++) {
    ind = bst1(a[i] - 1, 0, m - 1);
    v1 = 2 * i + (n - i) * 3;
    if (b[ind] == (a[i] - 1) || b[ind] < a[i] - 1) {
      v2 = 2 * (ind + 1) + 3 * (m - ind - 1);
    } else {
      v2 = 2 * (ind) + 3 * (m - ind);
    }
    if (val < (v1 - v2)) {
      val = v1 - v2;
      t1 = v1;
      t2 = v2;
    }
  }
  if (val < (n * 2 - m * 2)) {
    t1 = n * 2;
    t2 = m * 2;
  }
  cout << t1 << ":" << t2 << endl;
}
