#include <bits/stdc++.h>
using namespace std;
vector<long long int> v1, v2;
int main() {
  long long int ans = INT_MIN, a = 0, b = 0;
  int n, m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long int a;
    scanf("%lld", &a);
    v1.push_back(a);
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    long long int a;
    scanf("%lld", &a);
    v2.push_back(a);
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  for (int i = 0; i < n; i++) {
    long long int temp1 = 0;
    long long int temp2 = 0;
    long long int val = v1[i];
    if (val != 0) val = val - 1;
    vector<long long int>::iterator it;
    it = upper_bound(v1.begin(), v1.end(), val);
    temp1 = (it - v1.begin()) * 2 + (v1.end() - it) * 3;
    it = upper_bound(v2.begin(), v2.end(), val);
    temp2 = (it - v2.begin()) * 2 + (v2.end() - it) * 3;
    if (temp1 - temp2 > ans) {
      ans = temp1 - temp2;
      a = temp1;
      b = temp2;
    }
    if (temp1 - temp2 == ans && temp1 > a) {
      a = temp1;
      b = temp2;
    }
  }
  for (int i = 0; i < m; i++) {
    long long int temp1 = 0;
    long long int temp2 = 0;
    long long int val = v2[i];
    val = val;
    vector<long long int>::iterator it;
    it = upper_bound(v1.begin(), v1.end(), val);
    temp1 = (it - v1.begin()) * 2 + (v1.end() - it) * 3;
    it = upper_bound(v2.begin(), v2.end(), val);
    temp2 = (it - v2.begin()) * 2 + (v2.end() - it) * 3;
    if (temp1 - temp2 > ans) {
      ans = temp1 - temp2;
      a = temp1;
      b = temp2;
    }
    if (temp1 - temp2 == ans && temp1 > a) {
      a = temp1;
      b = temp2;
    }
  }
  cout << a << ":" << b << endl;
}
