#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
const long double pi = acos(-1);
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
long long a[1000000 + 10], b[(int)1e6];
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cout << fixed;
  cout.tie(0);
  cin.tie(0);
  int n, m;
  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);
  long long ca = 2 * n;
  long long cb = 2 * m;
  for (int(i) = 0; (i) < (n); (i)++) {
    int x = (int)(upper_bound(a, a + n, a[i] - 1) - a);
    long long canx = x * 2 + (n - x) * 3;
    int y = (int)(upper_bound(b, b + m, a[i] - 1) - b);
    long long cany = y * 2 + (m - y) * 3;
    if ((canx - cany > ca - cb) || (canx - cany == ca - cb && canx > ca))
      ca = canx, cb = cany;
  }
  for (int(i) = 0; (i) < (m); (i)++) {
    int x = (int)(upper_bound(a, a + n, b[i] - 1) - a);
    long long canx = x * 2 + (n - x) * 3;
    int y = (int)(upper_bound(b, b + m, b[i] - 1) - b);
    long long cany = y * 2 + (m - y) * 3;
    if ((canx - cany > ca - cb) || (canx - cany == ca - cb && canx > ca))
      ca = canx, cb = cany;
  }
  cout << ca << ":" << cb << '\n';
}
