#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> first;
  vector<int> second;
  int n, m;
  cin >> n;
  long long scoreA, maxA;
  maxA = scoreA = 3 * n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    first.push_back(x);
  }
  first.push_back(INT_MAX);
  cin >> m;
  long long scoreB, maxB;
  maxB = scoreB = 3 * m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    second.push_back(x);
  }
  second.push_back(INT_MAX);
  sort(first.begin(), first.end());
  sort(second.begin(), second.end());
  long long maxDiff = scoreA - scoreB;
  int i = 0, j = 0;
  while (i <= n && j <= m) {
    if (first[i] < second[j]) {
      scoreA--;
      i++;
    } else if (first[i] > second[j]) {
      scoreB--;
      j++;
    } else {
      scoreA--;
      scoreB--;
      i++;
      j++;
    }
    if (scoreA - scoreB > maxDiff) {
      maxDiff = scoreA - scoreB;
      maxA = scoreA;
      maxB = scoreB;
    }
  }
  cout << maxA << ':' << maxB << endl;
  return 0;
}
