#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > arr;
int main() {
  int n, temp, m, count1, count2, diff, ans1, ans2;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &temp);
    arr.push_back(make_pair(temp, 1));
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    scanf("%d", &temp);
    arr.push_back(make_pair(temp, 2));
  }
  count1 = n;
  count2 = m;
  sort(arr.begin(), arr.end());
  diff = ((count1 * 3 + (n - count1) * 2) - (count2 * 3 + (m - count2) * 2));
  ans1 = count1 * 3 + (n - count1) * 2;
  ans2 = count2 * 3 + (m - count2) * 2;
  for (int i = 0; i < arr.size(); i++) {
    if (i != arr.size() - 1 && arr[i + 1].first == arr[i].first) {
      if (arr[i].second == 1)
        count1--;
      else if (arr[i].second == 2)
        count2--;
      i++;
    }
    if (arr[i].second == 1)
      count1--;
    else if (arr[i].second == 2)
      count2--;
    if (((count1 * 3 + (n - count1) * 2) - (count2 * 3 + (m - count2) * 2)) >
        diff) {
      diff =
          ((count1 * 3 + (n - count1) * 2) - (count2 * 3 + (m - count2) * 2));
      ans1 = count1 * 3 + (n - count1) * 2;
      ans2 = count2 * 3 + (m - count2) * 2;
    }
  }
  cout << ans1 << ":" << ans2 << endl;
  return 0;
}
