#include <bits/stdc++.h>
using namespace std;
struct gtr {
  int x;
  bool y;
};
gtr a[1000000];
bool cmp(gtr a, gtr b) { return a.x < b.x; }
int main() {
  int n, m;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i].x);
    a[i].y = false;
  }
  scanf("%d", &m);
  for (int i = n; i < m + n; i++) {
    scanf("%d", &a[i].x);
    a[i].y = true;
  }
  sort(a, a + n + m, cmp);
  int sla = 0, slb = 0;
  int t = -1;
  int res = n * 3 - m * 3, resa = n * 3, resb = m * 3;
  while (t + 1 < m + n) {
    t++;
    if (a[t].y == true)
      slb++;
    else
      sla++;
    while (t + 1 < m + n && a[t + 1].x == a[t].x) {
      t++;
      if (a[t].y == true)
        slb++;
      else
        sla++;
    }
    if (res < (n - sla) * 3 + sla * 2 - (m - slb) * 3 - slb * 2) {
      res = (n - sla) * 3 + sla * 2 - (m - slb) * 3 - slb * 2;
      resa = (n - sla) * 3 + sla * 2;
      resb = (m - slb) * 3 + slb * 2;
    } else if (res == (n - sla) * 3 + sla * 2 - (m - slb) * 3 - slb * 2 &&
               resa < (n - sla) * 3 + sla * 2) {
      resa = (n - sla) * 3 + sla * 2;
      resb = (m - slb) * 3 + slb * 2;
    }
  }
  cout << resa << ":" << resb;
}
