#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, i, j, k;
  cin >> n;
  vector<int> v1, v2;
  for (i = 0; i < n; i++) {
    int x;
    cin >> x;
    v1.push_back(x);
  }
  cin >> m;
  for (i = 0; i < m; i++) {
    int x;
    cin >> x;
    v2.push_back(x);
  }
  int a = n * 3, b = m * 3, mx = a - b;
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  for (i = 0; i < n; i++) {
    if (i + 1 < n && v1[i] == v1[i + 1]) continue;
    int x = 2 * (i + 1) + 3 * (n - i - 1);
    int pos = upper_bound(v2.begin(), v2.end(), v1[i]) - v2.begin();
    int y = 2 * pos + 3 * (m - pos);
    if (x - y > mx) {
      mx = x - y;
      a = x;
      b = y;
    } else if (x - y == mx && x > a) {
      a = x;
      b = y;
    }
  }
  for (i = 0; i < m; i++) {
    if (i + 1 < m && v2[i] == v2[i + 1]) continue;
    int y = 2 * (i + 1) + 3 * (m - i - 1);
    int pos = upper_bound(v1.begin(), v1.end(), v2[i]) - v1.begin();
    int x = 2 * pos + 3 * (n - pos);
    if (x - y > mx) {
      mx = x - y;
      a = x;
      b = y;
    } else if (x - y == mx && x > a) {
      a = x;
      b = y;
    }
  }
  cout << a << ":" << b << "\n";
  return 0;
}
