#include <bits/stdc++.h>
using namespace std;
int n, m;
pair<int, int> v[400010];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    v[i] = make_pair(a, 1);
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    int a;
    scanf("%d", &a);
    v[i + n] = make_pair(a, -1);
  }
  sort(v, v + n + m);
  int x, y;
  int best = -1000000000;
  int bestx, besty;
  x = 0, y = 0;
  for (int i = 0; i < n + m; i++) {
    if (v[i].second == 1)
      x += 3;
    else
      y += 3;
  }
  best = x - y;
  bestx = x;
  besty = y;
  for (int i = 0; i < n + m; i++) {
    int j = i;
    while (j < n + m && v[j].first == v[i].first) {
      if (v[j].second == 1) {
        x -= 1;
      } else {
        y -= 1;
      }
      j++;
    }
    i = j - 1;
    if (x - y > best) {
      best = x - y;
      bestx = x;
      besty = y;
    } else if (best == x - y && x > bestx) {
      bestx = x;
      besty = y;
    }
  }
  cout << bestx << ":" << besty << endl;
  return 0;
}
