#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int N = 2e5;
int n, m, ans[2], cur[2];
int32_t a[N], b[N];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + m);
  int ans[] = {3 * n, 3 * m}, cur[] = {ans[0], ans[1]};
  int i = 0, j = 0, d = 0;
  while (i < n || j < m) {
    while (i < n && a[i] == d) i++, cur[0]--;
    while (j < m && b[j] == d) j++, cur[1]--;
    if (cur[0] - cur[1] > ans[0] - ans[1] ||
        (cur[0] - cur[1] == ans[0] - ans[1] && cur[0] > ans[0])) {
      ans[0] = cur[0], ans[1] = cur[1];
    }
    if (i < n && j < m) {
      d = min(a[i], b[j]);
    } else if (i < n) {
      d = a[i];
    } else {
      d = b[j];
    }
  }
  cout << ans[0] << ':' << ans[1] << endl;
  return 0;
}
