#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long int mod = 998244353;
long long int gprime[1000001];
void grsieve() {
  memset(gprime, 0, sizeof(gprime));
  gprime[1] = 1;
  gprime[0] = 0;
  for (long long int i = 2; i < 1000001; ++i) {
    if (gprime[i] == 0) {
      for (long long int j = i; j < 1000001; j += i) gprime[j] = i;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int test = 1;
  while (test--) {
    int n, m;
    cin >> n;
    long long int a[n];
    for (int i = 0; i < n; ++i) cin >> a[i];
    cin >> m;
    long long int b[m];
    for (int j = 0; j < m; ++j) cin >> b[j];
    sort(a, a + n);
    sort(b, b + m);
    int i = 0, j = 0;
    long long int ans = (3 * n) - (3 * m);
    long long int curra = 3 * n, currb = 3 * m;
    while (i < n || j < m) {
      if (i == n) {
        j++;
        long long int as = 2 * n, bs = (j * 2 + ((m - j) * 3));
        long long int temp = (2 * n) - (j * 2 + ((m - j) * 3));
        if (ans < temp) {
          curra = as;
          currb = bs;
        } else if (ans == temp) {
          if (as > curra) {
            curra = as;
            currb = bs;
          }
        }
        ans = max(ans, temp);
        continue;
      }
      if (j == m) {
        i++;
        long long int as = 2 * i + ((n - i) * 3), bs = 2 * m;
        long long int temp = (2 * i + ((n - i) * 3) - 2 * m);
        if (ans < temp) {
          curra = as;
          currb = bs;
        } else if (ans == temp) {
          if (as > curra) {
            curra = as;
            currb = bs;
          }
        }
        ans = max(ans, temp);
        continue;
      }
      if (a[i] == b[j]) {
        i++;
        j++;
        long long int as = 2 * i + ((n - i) * 3), bs = (j * 2 + ((m - j) * 3));
        long long int temp = 2 * i + ((n - i) * 3) - (j * 2 + ((m - j) * 3));
        if (ans < temp) {
          curra = as;
          currb = bs;
        } else if (ans == temp) {
          if (as > curra) {
            curra = as;
            currb = bs;
          }
        }
        ans = max(ans, temp);
        continue;
      } else if (a[i] > b[j]) {
        j++;
        long long int as = 2 * i + ((n - i) * 3), bs = (j * 2 + ((m - j) * 3));
        long long int temp = 2 * i + ((n - i) * 3) - (j * 2 + ((m - j) * 3));
        if (ans < temp) {
          curra = as;
          currb = bs;
        } else if (ans == temp) {
          if (as > curra) {
            curra = as;
            currb = bs;
          }
        }
        ans = max(ans, temp);
        continue;
      } else {
        i++;
        long long int as = 2 * i + ((n - i) * 3), bs = (j * 2 + ((m - j) * 3));
        long long int temp = 2 * i + ((n - i) * 3) - (j * 2 + ((m - j) * 3));
        if (ans < temp) {
          curra = as;
          currb = bs;
        } else if (ans == temp) {
          if (as > curra) {
            curra = as;
            currb = bs;
          }
        }
        ans = max(ans, temp);
        continue;
      }
    }
    cout << curra << ":" << currb;
  }
  return 0;
}
