#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int a[N], b[N], c[N * 2];
int main() {
  int n, m, cnt = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    cnt++;
    c[cnt] = a[i];
  }
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    cnt++;
    c[cnt] = b[i];
  }
  sort(a + 1, a + 1 + n);
  sort(b + 1, b + 1 + m);
  sort(c + 1, c + 1 + cnt);
  int suma = n * 2;
  int sumb = m * 2;
  int ans = suma - sumb;
  for (int i = cnt - 1; i >= 0; i--) {
    int numa = upper_bound(a + 1, a + 1 + n, c[i]) - a - 1;
    int numb = upper_bound(b + 1, b + 1 + m, c[i]) - b - 1;
    int ne = numa * 2 + (n - numa) * 3 - numb * 2 - (m - numb) * 3;
    if (ans <= ne) {
      suma = numa * 2 + (n - numa) * 3;
      sumb = numb * 2 + (m - numb) * 3;
      ans = suma - sumb;
    }
  }
  cout << suma << ":" << sumb << endl;
}
