#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
struct node {
  int t, v;
} p[N << 1];
int cmp(node a, node b) { return a.v < b.v; }
int main() {
  int n, m;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i].v);
    p[i].t = 1;
  }
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &p[n + i].v);
    p[n + i].t = 2;
  }
  sort(p, p + n + m, cmp);
  int fir = 3 * n, sec = 3 * m;
  int ans_f = fir, ans_s = sec;
  for (int i = 0; i < n + m; i++) {
    while (p[i].v == p[i + 1].v) {
      if (p[i].t == 1)
        fir--;
      else
        sec--;
      i++;
    }
    if (p[i].t == 1)
      fir--;
    else
      sec--;
    if (fir - sec > ans_f - ans_s) {
      ans_f = fir;
      ans_s = sec;
    }
  }
  printf("%d:%d\n", ans_f, ans_s);
  return 0;
}
