#include <bits/stdc++.h>
using namespace std;
struct point {
  long long id;
  long long v;
} p[400005], q[400005];
bool cmp(const point& a, const point& b) { return a.v < b.v; }
int num[400005], num2[400005];
int sum[400005], sum2[400005];
int main() {
  int n, m, i;
  long long x;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%I64d", &x);
    p[i].id = i;
    p[i].v = x;
    q[i].id = i;
    q[i].v = x;
  }
  scanf("%d", &m);
  for (i = 0; i < m; i++) {
    scanf("%I64d", &x);
    p[n + i].id = n + i;
    p[n + i].v = x;
    q[n + i].id = n + i;
    q[n + i].v = x;
  }
  sort(q, q + n + m, cmp);
  p[q[0].id].v = 1;
  int k = 1;
  for (i = 1; i < n + m; i++) {
    if (q[i].v > q[i - 1].v) k++;
    p[q[i].id].v = k;
  }
  for (i = 0; i < n; i++) {
    num[p[i].v]++;
  }
  for (i = n; i < n + m; i++) {
    num2[p[i].v]++;
  }
  sum[0] = 0;
  for (i = 1; i <= k; i++) {
    sum[i] = num[i] + sum[i - 1];
  }
  sum2[0] = 0;
  for (i = 1; i <= k; i++) {
    sum2[i] = num2[i] + sum2[i - 1];
  }
  int ans = -10000000;
  int ansx = -1;
  int ansy;
  for (i = 0; i <= k; i++) {
    int temp1 = sum[i] * 2 + (n - sum[i]) * 3;
    int temp2 = sum2[i] * 2 + (m - sum2[i]) * 3;
    if (temp1 - temp2 > ans || (temp1 - temp2 == ans && temp1 > ansx)) {
      ansx = temp1;
      ansy = temp2;
      ans = temp1 - temp2;
    }
  }
  printf("%d:%d\n", ansx, ansy);
  return 0;
}
