#include <bits/stdc++.h>
using namespace std;
const int MAX = 200010;
struct p {
  int a;
  int b;
  p(int a_, int b_) {
    a = a_;
    b = b_;
  }
  p(){};
};
map<int, p> br;
map<int, int> bio;
bool operator<(p x, p y) {
  if (x.a != y.a) return x.a < y.a;
  return x.b < y.b;
}
int n, m;
int a[MAX], b[MAX];
int x, y;
int sola, solb;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (!bio[a[i]]) {
      br[a[i]] = p(1, 0);
      bio[a[i]] = 1;
    } else {
      br[a[i]].a++;
    }
  }
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &b[i]);
    if (!bio[b[i]]) {
      br[b[i]] = p(0, 1);
      bio[b[i]] = 1;
    } else {
      br[b[i]].b++;
    }
  }
  sola = (n * 3);
  solb = (m * 3);
  map<int, p>::iterator it;
  for (it = br.begin(); it != br.end(); it++) {
    x += (it->second).a;
    y += (it->second).b;
    int ta = ((x * 2) + (n - x) * 3);
    int tb = ((y * 2) + (m - y) * 3);
    if ((ta - tb) > (sola - solb) ||
        (((ta - tb) == (sola - solb)) && (ta > sola))) {
      sola = ta;
      solb = tb;
    }
  }
  printf("%d:%d", sola, solb);
  return 0;
}
