#include <bits/stdc++.h>
using namespace std;
const int N = 200000;
int a[N], b[N], c[2 * N];
int main() {
  int n, m, num = 1;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    c[num++] = a[i];
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
    c[num++] = b[i];
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  sort(c + 1, c + num);
  int ans;
  int x, y;
  x = n * 2;
  y = m * 2;
  ans = x - y;
  for (int i = num - 1; i >= 0; i--) {
    int temp1 = upper_bound(a + 1, a + n + 1, c[i]) - a - 1;
    int temp2 = upper_bound(b + 1, b + m + 1, c[i]) - b - 1;
    if (ans <= temp1 * 2 + (n - temp1) * 3 - temp2 * 2 - (m - temp2) * 3) {
      x = temp1 * 2 + (n - temp1) * 3;
      y = temp2 * 2 + (m - temp2) * 3;
      ans = x - y;
    }
  }
  printf("%d:%d\n", x, y);
  return 0;
}
