#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > vec;
int a, b;
int main() {
  cin >> a;
  int A = 0, B = 0;
  for (int i = 0; i < a; i++) {
    int tmp;
    cin >> tmp;
    vec.push_back(make_pair(tmp, 1));
    A += 3;
  }
  cin >> b;
  for (int i = 0; i < b; i++) {
    int tmp;
    cin >> tmp;
    vec.push_back(make_pair(tmp, 2));
    B += 3;
  }
  sort(vec.begin(), vec.end());
  int fareg = A - B;
  int tmp1 = A, tmp2 = B;
  for (int i = 0; i < (int)vec.size(); i++) {
    if (vec[i].second == 1) {
      tmp1 -= 1;
      int Z = i;
      while (true) {
        Z++;
        if (Z >= (int)vec.size() || vec[i].first != vec[Z].first) break;
        if (vec[Z].second == 1)
          tmp1 -= 1;
        else
          tmp2 -= 1;
        i++;
      }
      if ((tmp1 - tmp2) > fareg) {
        fareg = tmp1 - tmp2;
        A = tmp1;
        B = tmp2;
      } else if ((tmp1 - tmp2) == fareg) {
        if (tmp1 > A) {
          A = tmp1;
        }
      } else {
      }
    } else {
      tmp2 -= 1;
      int Z = i;
      while (true) {
        Z++;
        if (Z >= (int)vec.size() || vec[i].first != vec[Z].first) break;
        if (vec[Z].second == 1)
          tmp1 -= 1;
        else
          tmp2 -= 1;
        i++;
      }
      if ((tmp1 - tmp2) > fareg) {
        fareg = tmp1 - tmp2;
        B = tmp2;
        A = tmp1;
      } else if ((tmp1 - tmp2) == fareg) {
        if (tmp1 > A) {
          A = tmp1;
        }
      } else {
      }
    }
  }
  cout << A << ":" << B << endl;
  return 0;
}
