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.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Set;
import java.util.StringTokenizer;

public class q6 {

	 public static int gcd(int a,int b) {
		 if(b==0) return a;
		 else return gcd(b,a%b);
	 }
	 
	 
	 
	 
	 
	 
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Reader.init(System.in);
		StringBuffer output=new StringBuffer("");
		PrintWriter out=new PrintWriter(System.out);
		int n=Reader.nextInt();
		int[] arr=new int[n+1];
		int min=Integer.MAX_VALUE;
		for(int i=0;i<n;i++) {arr[i]=Reader.nextInt();min=Math.min(arr[i], min);}
		arr[n]=min-1;
		Arrays.sort(arr);
		int m=Reader.nextInt();
		int[] arr2=new int[m];
		for(int i=0;i<m;i++) arr2[i]=Reader.nextInt();
		Arrays.sort(arr2);
		int diff=3*n-3*m;
		int sum1=3*n;
		int sum2=3*m;
		if(2*n-2*m>diff) {
			diff=2*n-2*m;
			sum1=2*n;sum2=2*m;
		}
		for(int i=0;i<=n;i++) {
			int low=0;
			int high=m-1;
			int val=0;
			boolean found=false;
			if(i!=n && arr[i+1]==arr[i]) continue;
			while(low<=high) {
				int middle=(low+high)/2;
				if(arr2[middle]>arr[i]) {
					val=middle;
					high=middle-1;
					found=true;
				}
				else {
					low=middle+1;
				}
			}
			if(found) {
				int s1=(i)*2+(n-i)*3;
				int s2=(val)*2+(m-val)*3;
				if(s1-s2>diff) {
					sum1=s1;
					sum2=s2;
					diff=s1-s2;
				}
				else if(s1-s2==diff && s1>sum1) {
					sum1=s1;sum2=s2;
				}
			}
			else {
				int s1=(i)*2+(n-i)*3;
				int s2=m*2;
				if(s1-s2>diff) {
					sum1=s1;
					sum2=s2;
					diff=s1-s2;
				}
				else if(s1-s2==diff && s1>sum1) {
					sum1=s1;sum2=s2;
				}
			}
		}
		for(int i=0;i<m;i++) {
			int low=0;
			int high=n;
			int val=0;
			boolean found=false;
			if(i!=m-1 && arr2[i+1]==arr2[i]) continue;
			while(low<=high) {
				int middle=(low+high)/2;
				if(arr[middle]>arr2[i]) {
					val=middle;
					high=middle-1;
					found=true;
				}
				else {
					low=middle+1;
				}
			}
			if(found) {
				if(val==0)
					val+=1;
				int s1=(val-1)*2+(n-val+1)*3;
				int s2=(i+1)*2+(m-i-1)*3;
				if(s1-s2>diff) {
					sum1=s1;
					sum2=s2;
					diff=s1-s2;
				}
				else if(s1-s2==diff && s1>sum1) {
					sum1=s1;sum2=s2;
				}
			}
			else {
				int s1=n*2;
				int s2=(i+1)*2+(m-i-1)*3;
				if(s1-s2>diff) {
					sum1=s1;
					sum2=s2;
					diff=s1-s2;
				}
				else if(s1-s2==diff && s1>sum1) {
					sum1=s1;sum2=s2;
				}
			}
		}
		
		output.append(sum1);output.append(":");output.append(sum2);
		
		
		out.write(output.toString());
		out.flush();
		
	}
}
 class Naya{
	 String team;
	 int num;
	 int time;
	 Naya(String a,int b, int c){
		 team=a;num=b;time=c;
	 }
 }
 
 class Reader {
	    static BufferedReader reader;
	    static StringTokenizer tokenizer;
	 
	    /** call this method to initialize reader for InputStream */
	    static void init(InputStream input) {
	        reader = new BufferedReader(
	                     new InputStreamReader(input) );
	        tokenizer = new StringTokenizer("");
	    }
	 
	    /** get next word */
	    
	    static String next() throws IOException {
	        while ( ! tokenizer.hasMoreTokens() ) {
	            //TODO add check for eof if necessary
	            tokenizer = new StringTokenizer(
	                   reader.readLine() );
	        }
	        return tokenizer.nextToken();
	    }
	 
	    static int nextInt() throws IOException {
	        return Integer.parseInt( next() );
	    }
	    static long nextLong() throws IOException {
	        return Long.parseLong( next() );
	    }
	    static double nextDouble() throws IOException {
	        return Double.parseDouble( next() );
	    }
	}