#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void print(vector<long long> v) {
  for (long long i = 0; i < (long long)v.size(); i++) cout << v[i];
  cout << endl;
}
int check_inc(vector<int> v) {
  for (long long i = 0; i < (long long)v.size() - 1; i++)
    if (v[i] > v[i + 1]) return 0;
  return 1;
}
vector<long long> div(int n) {
  vector<long long> v;
  for (long long i = 1; i < (long long)sqrt(n) + 1; i++) {
    if ((n % i) == 0) {
      if (i == n / i)
        v.push_back(i);
      else {
        v.push_back(i);
        v.push_back(n / i);
      }
    }
  }
  return v;
}
long long powmod(long long a, long long b, long long c) {
  if (b == 0)
    return 1 % c;
  else if (b % 2 == 0)
    return powmod((a * a) % c, b / 2, c);
  return (a * powmod((a * a) % c, (b - 1) / 2, c)) % c;
}
long long check(vector<long long> v) {
  for (long long i = 0; i < (long long)v.size() - 1; i++)
    if (v[i] != v[i + 1]) return 0;
  return 1;
}
void printp(vector<pair<long long, long long> > v) {
  for (long long i = 0; i < (long long)v.size(); i++)
    cout << v[i].first << " " << v[i].second << endl;
}
int prefix(string a, string b) {
  if (a.size() > b.size()) return 0;
  for (long long i = 0; i < (long long)a.size(); i++)
    if (a[i] != b[i]) return 0;
  return 1;
}
int suffix(string a, string b) {
  if (a.size() > b.size()) return 0;
  for (int i = a.size() - 1; i >= 0; i--)
    if (a[i] != b[b.size() - a.size() + i]) return 0;
  return 1;
}
vector<long long> fact(long long n) {
  vector<long long> v(n + 1);
  v[0] = 1;
  for (long long i = 1; i < (long long)n + 1; i++)
    v[i] = (v[i - 1] * i) % 998244353;
  return v;
}
vector<long long> binom(long long n) {
  vector<long long> v = fact(n);
  vector<long long> res(n + 1);
  for (long long i = 0; i < (long long)n + 1; i++)
    res[i] = (v[n] * (powmod(v[n - i], 998244353 - 2, 998244353))) % 998244353;
  return res;
}
long long cnt(long long n) {
  long long counter = 0;
  while (n != 0) {
    if (n % 2 == 1) counter++;
    n = n / 2;
  }
  return counter;
}
int main() {
  long long n, m;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < (long long)n; i++) cin >> a[i];
  cin >> m;
  vector<long long> b(m);
  for (long long i = 0; i < (long long)m; i++) cin >> b[i];
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  long long max = 0, pos = -1;
  vector<long long> ps;
  long long i = 0;
  while (i < m) {
    long long val = b[i];
    while (b[i] == val && i < m) i++;
    ps.push_back(i - 1);
  }
  for (long long i = 0; i < (long long)ps.size(); i++) {
    long long tmp = b[ps[i]];
    long long curr = upper_bound(a.begin(), a.end(), tmp) - a.begin();
    long long val = ps[i] + 1 - curr;
    if (val > max) {
      max = val;
      pos = ps[i];
    }
  }
  if (max <= 0) {
    long long cnt1 = 0, cnt2 = 0;
    ;
    for (long long i = 0; i < (long long)n; i++) cnt1 += 3;
    for (long long i = 0; i < (long long)m; i++) cnt2 += 3;
    cout << cnt1 << ":" << cnt2;
  } else {
    long long cnt1 = 0, cnt2 = 0;
    for (long long i = 0; i < (long long)pos + 1; i++) cnt2 += 2;
    for (long long i = pos + 1; i < (long long)m; i++) cnt2 += 3;
    long long val = b[pos];
    int j = 0;
    while (j < n) {
      if (a[j] <= val)
        cnt1 += 2;
      else
        cnt1 += 3;
      j++;
    }
    cout << cnt1 << ":" << cnt2;
  }
  return 0;
}
