#include <bits/stdc++.h>
using namespace std;
class Graph {
 public:
  int V;
  vector<vector<int> > adj;
  Graph() : V(0) {}
  Graph(int n) : V(n), adj(n) {}
  void add_edge(int u, int v) {
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  void resize(int n) {
    for (int i = 0; i < int((adj).size()); i++) {
      adj[i].clear();
    }
    V = n;
    adj.clear();
    adj = vector<vector<int> >(n);
  }
};
inline int gcd(int a, int b) {
  while (a > 0 && b > 0) {
    if (a > b)
      a %= b;
    else
      b %= a;
  }
  return a + b;
}
vector<pair<int, int> > a, sc;
vector<int> b;
int main() {
  long long n, m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int val;
    scanf("%d", &val);
    a.push_back(make_pair(val, 0));
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    int val;
    scanf("%d", &val);
    a.push_back(make_pair(val, 1));
  }
  int x[2] = {0, 0}, maxv = 0, ind = -1;
  sort(a.begin(), a.end());
  for (int i = 0; i < int((a).size()); i++) {
    x[a[i].second]++;
    b.push_back(x[1] - x[0]);
    sc.push_back(make_pair(x[0], x[1]));
  }
  for (int i = 0; i < int((a).size()); i++) {
    if (b[i] > maxv) {
      maxv = b[i];
      ind = i;
    }
  }
  if (ind == -1) {
    cout << n * 3 << ":" << m * 3 << endl;
  } else {
    cout << (n - sc[ind].first) * 3 + ((long long)sc[ind].first) * 2 << ":"
         << (m - sc[ind].second) * 3 + ((long long)sc[ind].second) * 2 << endl;
  }
  return 0;
}
