#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  pair<int, int> Calculate3PointsLine(int n, vector<int> &a, int m,
                                      vector<int> &b) {
    pair<int, int> ans;
    ans.first = n * 2;
    ans.second = m * 2;
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    for (int i = 0, j = 0; i < n; i++) {
      while ((j < m) && (b[j] < a[i])) {
        j++;
      }
      pair<int, int> temp;
      temp.first = i * 2 + (n - i) * 3;
      temp.second = j * 2 + (m - j) * 3;
      if ((temp.second - temp.first < ans.second - ans.first) ||
          ((temp.second - temp.first == ans.second - ans.first) &&
           (temp.first > ans.first))) {
        ans = temp;
      }
    }
    return ans;
  }
};
int main() {
  int n, m;
  vector<int> a, b;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int temp;
    scanf("%d", &temp);
    a.push_back(temp);
  }
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int temp;
    scanf("%d", &temp);
    b.push_back(temp);
  }
  Solution aa;
  pair<int, int> ans = aa.Calculate3PointsLine(n, a, m, b);
  printf("%d:%d\n", ans.first, ans.second);
  return 0;
}
