#include <bits/stdc++.h>
using namespace std;
int main() {
  set<long long> memo;
  long long n;
  cin >> n;
  long long a[n];
  long long sum1 = n * 3;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    memo.insert(a[i]);
  }
  long long m;
  cin >> m;
  long long b[m];
  long long sum2 = m * 3;
  for (int i = 0; i < m; i++) {
    cin >> b[i];
    memo.insert(b[i]);
  }
  sort(a, a + n);
  sort(b, b + m);
  long long difmax = sum1 - sum2;
  long long firPoi, secPoi;
  firPoi = sum1;
  secPoi = sum2;
  int i, j;
  i = j = 0;
  for (set<long long>::iterator it = memo.begin(); it != memo.end(); it++) {
    long long d = *it;
    for (; i < n && a[i] <= d; i++)
      ;
    for (; j < m && b[j] <= d; j++)
      ;
    long long s1, s2;
    s1 = sum1 - i;
    s2 = sum2 - j;
    if (difmax < s1 - s2) {
      difmax = s1 - s2;
      firPoi = s1;
      secPoi = s2;
    }
  }
  cout << firPoi << ":" << secPoi << endl;
}
