#include <bits/stdc++.h>
using namespace std;
map<long long int, int> m1;
map<long long int, int> m2;
int main() {
  int n, m;
  cin >> n;
  long long int a;
  long long int o = 0;
  long long int v[n];
  for (int i = 0; i < n; i++) {
    cin >> a;
    m1[a]++;
    o = max(o, a);
    v[i] = a;
  }
  cin >> m;
  long long int v1[m];
  for (int i = 0; i < m; i++) {
    cin >> a;
    m2[a]++;
    o = max(o, a);
    v1[i] = a;
  }
  sort(v, v + n);
  sort(v1, v1 + m);
  long long int s = 3 * n, s1 = 3 * m, d = s - s1, p = 1;
  long long int x = s, x1 = s1;
  int i = 0, j = 0;
  while ((i < n) || (j < m)) {
    if (v[i] < v1[j]) {
      x -= m1[v[i]];
      i += m1[v[i]];
    } else if (v[i] > v1[j]) {
      x1 -= m2[v1[j]];
      j += m2[v1[j]];
    } else {
      x -= m1[v[i]];
      i += m1[v[i]];
      x1 -= m2[v1[j]];
      j += m2[v1[j]];
    }
    if (x - x1 > d) {
      s = x;
      s1 = x1;
      d = x - x1;
    }
  }
  cout << s << ":" << s1;
}
