Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger than d meters, where d is some non-negative integer.

Vasya would like the advantage of the points scored by the first team (the points of the first team minus the points of the second team) to be maximum. For that he can mentally choose the value of d. Help him to do that.

Input

The first line contains integer n (1 ≤ n ≤ 2·105) — the number of throws of the first team. Then follow n integer numbers — the distances of throws ai (1 ≤ ai ≤ 2·109). 

Then follows number m (1 ≤ m ≤ 2·105) — the number of the throws of the second team. Then follow m integer numbers — the distances of throws of bi (1 ≤ bi ≤ 2·109).

Output

Print two numbers in the format a:b — the score that is possible considering the problem conditions where the result of subtraction a - b is maximum. If there are several such scores, find the one in which number a is maximum.

Examples

Input

3
1 2 3
2
5 6


Output

9:6


Input

5
6 7 8 9 10
5
1 2 3 4 5


Output

15:10
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.InputStreamReader;
import java.util.function.IntPredicate;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        VasyaAndBasketball solver = new VasyaAndBasketball();
        solver.solve(1, in, out);
        out.close();
    }

    static class VasyaAndBasketball {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n1 = in.nextInt();
            int[] arr1 = in.nextIntArray(0, n1);
            int n2 = in.nextInt();
            int[] arr2 = in.nextIntArray(0, n2);
            Arrays.sort(arr1);
            Arrays.sort(arr2);
            Pair<Integer, Integer> score1 = getMaxScore1(arr1, n1, arr2, n2);
            Pair<Integer, Integer> score2 = getMaxScore2(arr1, n1, arr2, n2);
            Pair<Integer, Integer> score3 = new Pair<>(3 * n1, 3 * n2);
            Pair<Integer, Integer> score = bestOf(bestOf(score1, score2), score3);
//        if (score.first - score.second < 0) {
//            score = score3;
//        }
            out.println(score.first + ":" + score.second);
        }

        Pair<Integer, Integer> getMaxScore1(int[] arr1, int n1, int[] arr2, int n2) {
            int score1 = Integer.MIN_VALUE, score2 = 0;
            for (int i = 0; i < n1; i++) {
                int e = arr1[i];
                while (i < n1 && arr1[i] == e) i++;
                i--;
                int j = Utils.upperBound(arr2, 0, n2 - 1, idx -> arr2[idx] <= e);
                int localScore1 = 2 * (i + 1) + 3 * (n1 - i - 1);
                int localScore2 = j == -1 ? 3 * n2 : 2 * (j + 1) + 3 * (n2 - j - 1);
                if (localScore1 - localScore2 > score1 - score2) {
                    score1 = localScore1;
                    score2 = localScore2;
                } else if (localScore1 - localScore2 == score1 - localScore2) {
                    if (localScore1 > score1) {
                        score1 = localScore1;
                        score2 = localScore2;
                    }
                }
            }
            return new Pair<>(score1, score2);
        }

        Pair<Integer, Integer> getMaxScore2(int[] arr1, int n1, int[] arr2, int n2) {
            int score1 = Integer.MIN_VALUE, score2 = 0;
            for (int i = 0; i < n2; i++) {
                int e = arr2[i];
                while (i < n2 && arr2[i] == e) i++;
                i--;
                int j = Utils.upperBound(arr1, 0, n1 - 1, idx -> arr1[idx] <= e);
                int localScore2 = 2 * (i + 1) + 3 * (n2 - i - 1);
                int localScore1 = j == -1 ? 3 * n1 : 2 * (j + 1) + 3 * (n1 - j - 1);
                if (localScore1 - localScore2 > score1 - score2) {
                    score1 = localScore1;
                    score2 = localScore2;
                } else if (localScore1 - localScore2 == score1 - localScore2) {
                    if (localScore1 > score1) {
                        score1 = localScore1;
                        score2 = localScore2;
                    }
                }
            }
            return new Pair<>(score1, score2);
        }

        Pair<Integer, Integer> bestOf(Pair<Integer, Integer> score1, Pair<Integer, Integer> score2) {
            if (score1.first - score1.second > score2.first - score2.second) {
                return score1;
            } else if (score1.first - score1.second < score2.first - score2.second) {
                return score2;
            } else {
                if (score1.first > score2.first) {
                    return score1;
                } else {
                    return score2;
                }
            }
        }

    }

    static class Utils {
        public static int upperBound(int[] arr, int l, int r, IntPredicate filter) {
            int m, answer = -1;
            while (l <= r) {
                m = (l + r) >> 1;
                if (filter.test(m)) {
                    answer = m;
                    l = m + 1;
                } else {
                    r = m - 1;
                }
            }
            return answer;
        }

    }

    static class InputReader {
        private StringTokenizer tokenizer;
        private BufferedReader reader;

        public InputReader(InputStream inputStream) {
            reader = new BufferedReader(new InputStreamReader(inputStream));
        }

        private void fillTokenizer() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        }

        public String next() {
            fillTokenizer();
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public int[] nextIntArray(int offset, int length) {
            int[] arr = new int[offset + length];
            for (int i = offset; i < offset + length; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

    }

    static class Pair<U, V> {
        public U first;
        public V second;

        public Pair() {
        }

        public Pair(U first, V second) {
            this.first = first;
            this.second = second;
        }


        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!first.equals(pair.first)) return false;
            return second.equals(pair.second);
        }


        public int hashCode() {
            int result = first.hashCode();
            result = 31 * result + second.hashCode();
            return result;
        }


        public String toString() {
            return "Pair{" + "first=" + first + ", second=" + second + '}';
        }

    }
}

