#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-11;
class TimeTracker {
  clock_t start, end;

 public:
  TimeTracker() { start = clock(); }
  ~TimeTracker() {
    end = clock();
    fprintf(stderr, "RunTime : %.3lf s\n",
            (double)(end - start) / CLOCKS_PER_SEC);
  }
};
template <class T>
inline void mswap(T& a, T& b) {
  a ^= b;
  b ^= a;
  a ^= b;
}
template <class T>
inline void bswap(T& a, T& b) {
  T temp;
  temp = a;
  a = b;
  b = temp;
}
template <class T>
inline T min(T& a, T& b) {
  if (a < b) {
    return a;
  } else
    return b;
}
template <class T>
inline T max(T& a, T& b) {
  if (a > b) {
    return a;
  } else
    return b;
}
template <class T>
void inp(T& n) {
  n = 0;
  int ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  n = n * sign;
}
template <class T>
void oup(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  int len = 0, data[25];
  while (x) {
    data[len++] = x % 10;
    x /= 10;
  }
  if (!len) data[len++] = 0;
  while (len--) putchar(data[len] + 48);
  putchar('\n');
}
int main() {
  long long int n, m, i, j, k, mx, argmx, sa, sb;
  long long int* a = new long long int[200010];
  long long int* b = new long long int[200010];
  long long int* c = new long long int[400020];
  long long int* s = new long long int[400020];
  inp(n);
  for (i = 0; i < n; i++) {
    inp(a[i]);
  }
  inp(m);
  for (i = 0; i < m; i++) {
    inp(b[i]);
  }
  sort(a, a + n);
  sort(b, b + m);
  i = j = 0;
  for (k = 0; k < n + m; k++) {
    if (i == n) {
      c[k] = -b[j];
      j++;
      continue;
    }
    if (j == m) {
      c[k] = a[i];
      i++;
      continue;
    }
    if (a[i] < b[j]) {
      c[k] = a[i];
      i++;
    } else {
      c[k] = -b[j];
      j++;
    }
  }
  for (k = 0; k < n + m; k++) {
    s[k] = ((c[k] > 0) ? 1 : -1) + ((k > 0) ? s[k - 1] : 0);
  }
  for (k = -1; k < n + m; k++) {
    if (k < 0) {
      mx = 3 * s[n + m - 1];
      argmx = k;
    } else {
      while ((k + 1) < (n + m) && (c[k] < 0 ? -(c[k]) : c[k]) ==
                                      (c[k + 1] < 0 ? -(c[k + 1]) : c[k + 1]))
        k++;
      if (mx < ((3 * s[n + m - 1]) - s[k])) {
        mx = ((3 * s[n + m - 1]) - s[k]);
        argmx = k;
      }
    }
  }
  sa = sb = 0;
  for (i = 0; i < n; i++)
    if (argmx != -1 && a[i] <= (c[argmx] < 0 ? -(c[argmx]) : c[argmx]))
      sa += 2;
    else
      sa += 3;
  for (i = 0; i < m; i++)
    if (argmx != -1 && b[i] <= (c[argmx] < 0 ? -(c[argmx]) : c[argmx]))
      sb += 2;
    else
      sb += 3;
  cout << sa << ':' << sb << '\n';
  return 0;
}
