#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int temp;
  map<int, pair<int, int> > mp;
  for (int i = 0; i < n; i++) {
    scanf("%d", &temp);
    mp[temp].first += 1;
  }
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &temp);
    mp[temp].second += 1;
  }
  long long asum = 0, bsum = 0;
  for (map<int, pair<int, int> >::iterator it = mp.begin(); it != mp.end();
       it++) {
    asum += 3 * (*it).second.first;
    bsum += 3 * (*it).second.second;
  }
  vector<pair<long long, long long> > v;
  v.push_back(make_pair(asum - bsum, asum));
  for (map<int, pair<int, int> >::iterator it = mp.begin(); it != mp.end();
       it++) {
    asum -= (*it).second.first;
    bsum -= (*it).second.second;
    v.push_back(make_pair(asum - bsum, asum));
  }
  sort(v.begin(), v.end());
  long long ansa = v.back().second;
  long long ansb = v.back().second - v.back().first;
  printf("%I64d:%I64d", ansa, ansb);
  return 0;
}
