#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> shotA, shotB;
vector<int> shotAll;
int getPostion(int value);
int main() {
  scanf("%d", &(n));
  for (int i = 0; i < n; i++) {
    int tmp;
    scanf("%d", &(tmp));
    shotA.push_back(tmp);
    shotAll.push_back(tmp);
  }
  sort(shotA.begin(), shotA.end());
  scanf("%d", &(m));
  for (int i = 0; i < m; i++) {
    int tmp;
    scanf("%d", &(tmp));
    shotB.push_back(tmp);
    shotAll.push_back(tmp);
  }
  sort(shotB.begin(), shotB.end());
  int maxDiff = 3 * (shotA.size() - shotB.size());
  int score1 = 3 * shotA.size(), score2 = 3 * shotB.size();
  int scoreDiff = 0;
  sort(shotAll.begin(), shotAll.end());
  for (int i = 0; i < shotAll.size(); i++) {
    int value = shotAll[i];
    int posA = upper_bound(shotA.begin(), shotA.end(), value) - shotA.begin();
    int posB = upper_bound(shotB.begin(), shotB.end(), value) - shotB.begin();
    int scoreA = posA * 2 + (n - posA) * 3;
    int scoreB = posB * 2 + (m - posB) * 3;
    scoreDiff = scoreA - scoreB;
    if (scoreDiff > maxDiff) {
      maxDiff = scoreDiff;
      score1 = scoreA;
      score2 = scoreB;
    } else if (scoreDiff == maxDiff) {
      if (scoreA > score1) {
        score1 = scoreA;
        score2 = scoreB;
      }
    }
  }
  cout << score1 << ":" << score2 << endl;
  return 0;
}
