#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5 + 5;
const int oo = 1e9;
int n, m, len;
int a[maxN], b[maxN];
vector<int> tmp;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  scanf("%d", &m);
  for (int i = 1; i <= m; ++i) scanf("%d", &b[i]);
  sort(b + 1, b + m + 1);
  tmp.push_back(oo);
  for (int i = 1; i <= n; ++i) tmp.push_back(a[i]);
  for (int i = 1; i <= m; ++i) tmp.push_back(b[i]);
  sort(tmp.begin(), tmp.end());
  len = unique(tmp.begin(), tmp.end()) - tmp.begin();
  int posa = 0, posb = 0;
  int res = -oo, res1 = 0, res2 = 0;
  for (int i = 0; i < len; ++i) {
    int value = tmp[i];
    while (posa < n && a[posa + 1] < value) ++posa;
    while (posb < m && b[posb + 1] < value) ++posb;
    int suma = posa * 2 + (n - posa) * 3;
    int sumb = posb * 2 + (m - posb) * 3;
    if (suma - sumb > res) {
      res = suma - sumb;
      res1 = suma;
      res2 = sumb;
    } else if (suma - sumb == res && suma > res1) {
      res1 = suma;
      res2 = sumb;
    }
  }
  printf("%d:%d", res1, res2);
  return 0;
}
