#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int main() {
  int n, m;
  cin >> n;
  vector<long long> a(n + 1);
  a[0] = 0;
  map<long long, int> mp1, mp2;
  long long s1 = 0, s2 = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    s1 += a[i];
    mp1[a[i]]++;
  }
  cin >> m;
  vector<long long> b(m + 1);
  b[0] = 0;
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    s2 += b[i];
    mp2[b[i]]++;
  }
  s1 = n, s2 = m;
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  long long ans1 = -100000000000000, ans2 = 100000000000000000;
  for (int i = 0; i < a.size(); i++) {
    long long d = a[i];
    long long pos = upper_bound(a.begin(), a.end(), d) - a.begin();
    pos--;
    long long p = upper_bound(b.begin(), b.end(), d) - b.begin();
    p--;
    s1 = pos * 2 + (n - pos) * 3;
    s2 = p * 2 + (m - p) * 3;
    if (s1 - s2 > ans1 - ans2 || (s1 - s2 == ans1 - ans2 && s1 > ans2)) {
      ans1 = s1;
      ans2 = s2;
    }
  }
  for (int i = 0; i < b.size(); i++) {
    long long d = b[i];
    long long pos = upper_bound(a.begin(), a.end(), d) - a.begin();
    pos--;
    long long p = upper_bound(b.begin(), b.end(), d) - b.begin();
    p--;
    s1 = pos * 2 + (n - pos) * 3;
    s2 = p * 2 + (m - p) * 3;
    if (s1 - s2 > ans1 - ans2 || (s1 - s2 == ans1 - ans2 && s1 > ans1)) {
      ans1 = s1;
      ans2 = s2;
    }
  }
  cout << ans1 << ':' << ans2;
}
