#include <bits/stdc++.h>
using namespace std;
pair<long, long> x[2000004];
int main() {
  long n;
  cin >> n;
  for (long i = 1; i <= n; i++) {
    cin >> x[i].first;
    x[i].second = 1;
  }
  long m;
  cin >> m;
  for (long i = n + 1; i <= n + m; i++) {
    cin >> x[i].first;
    x[i].second = 2;
  }
  sort(x + 1, x + n + m + 1);
  long a = 3 * n;
  long b = 3 * m;
  long long p = a - b;
  long na = 0;
  long nb = 0;
  for (long i = 1; i <= n + m; i++) {
    if (x[i].second == 1)
      na++;
    else
      nb++;
    if (x[i + 1].first != x[i].first) {
      long long h = n - na;
      long long e = m - nb;
      h = h * 3 + na * 2;
      e = e * 3 + nb * 2;
      if (h - e > p) {
        p = h - e;
        a = h;
        b = e;
      } else {
        if (h - e == p && h > a) {
          a = h;
          b = e;
        }
      }
    }
  }
  cout << a << ":" << b << endl;
}
