#include <bits/stdc++.h>
using namespace std;
const double h = 1e-6;
const int MAX_ = 100005;
inline long long int mul(long long int a, long long int b) {
  return (a * 1ll * b) % 1000000007;
}
inline long long int sub(long long int a, long long int b) {
  long long int c = a - b;
  if (c < 0) c += 1000000007;
  return c;
}
inline long long int add(long long int a, long long int b) {
  long long int c = a + b;
  if (c > 1000000007) c -= 1000000007;
  return c;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  vector<pair<long long int, int> > v;
  int n;
  cin >> n;
  long long int val;
  for (long long int i = 0; i < n; i++) {
    cin >> val;
    v.push_back({val, 1});
  }
  int m;
  cin >> m;
  for (long long int i = 0; i < m; i++) {
    cin >> val;
    v.push_back({val, 2});
  }
  sort(v.begin(), v.end());
  long long int ansa = 2 * n;
  long long int ansb = 2 * m;
  long long int diff = ansa - ansb;
  int l = 0, r = 0;
  for (int i = v.size() - 1; i >= 0; i--) {
    if (v[i].second == 1)
      l++;
    else
      r++;
    long long int x1 = l * 3 + (n - l) * 2;
    long long int x2 = r * 3 + (m - r) * 2;
    if (x1 - x2 > diff) {
      diff = x1 - x2;
      ansa = x1;
      ansb = x2;
    } else if (x1 - x2 == diff && x1 > ansa) {
      ansa = x1;
      ansb = x2;
    }
  }
  cout << ansa << ":" << ansb;
  return 0;
}
