#include <bits/stdc++.h>
using namespace std;
int n, m, ans[2];
vector<pair<int, bool>> score;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int sc;
    cin >> sc;
    score.push_back(make_pair(sc, 0));
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    int sc;
    cin >> sc;
    score.push_back(make_pair(sc, 1));
  }
  sort(score.begin(), score.end());
  int res[2] = {n * 3, m * 3};
  ans[0] = n * 3;
  ans[1] = m * 3;
  for (int i = 0; i < n + m; i++) {
    --res[score[i].second];
    if (res[0] - res[1] > ans[0] - ans[1]) {
      ans[0] = res[0];
      ans[1] = res[1];
    }
  }
  cout << ans[0] << ':' << ans[1] << endl;
  return 0;
}
