#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
const int inf = 0x3f3f3f3f;
int n, m;
int main() {
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) cin >> a[i];
  cin >> m;
  vector<int> b(m + 1);
  for (int i = 1; i <= m; i++) cin >> b[i];
  sort(a.begin() + 1, a.end());
  sort(b.begin() + 1, b.end());
  int ans = 3 * n - 3 * m, x = 0, y = 0;
  for (int i = 1; i <= m; i++) {
    int pos = upper_bound(a.begin() + 1, a.end(), b[i]) - a.begin();
    while (pos != n + 1 && a[pos] == b[i]) pos++;
    if (ans < 3 * (n - m) + (i - pos + 1))
      ans = 3 * (n - m) + (i - pos + 1), x = pos - 1, y = i;
  }
  cout << 3 * n - x << ":" << 3 * m - y;
  return 0;
}
