#include <bits/stdc++.h>
using namespace std;
priority_queue<int> que1, que2;
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    int num;
    cin >> num;
    que1.push(-num);
  }
  int M;
  cin >> M;
  for (int i = 0; i < M; ++i) {
    int num;
    cin >> num;
    if (num >= -que1.top()) que2.push(-num);
  }
  long long sum1 = N * 3;
  long long sum2 = (M - que2.size()) * 2 + que2.size() * 3;
  long long d = sum1 - sum2;
  long long temp1 = sum1, temp2 = sum2;
  while (!que1.empty() || !que2.empty()) {
    if (que2.empty()) break;
    if (!que1.empty()) {
      que1.pop();
      sum1--;
      while (que2.top() > que1.top() && que2.size()) {
        que2.pop();
        sum2--;
      }
    } else {
      que2.pop();
      sum2--;
    }
    if (sum1 - sum2 > d) {
      temp1 = sum1;
      temp2 = sum2;
      d = sum1 - sum2;
    }
  }
  cout << temp1 << ":" << temp2 << endl;
  return 0;
}
