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.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
	public static void main(String args[]) throws IOException{
		Reader.init(System.in); 
		ArrayList<Long> t1=new ArrayList<Long>();
		ArrayList<Long> t2=new ArrayList<Long>();
		int n=Reader.nextInt();
		long max1=1;
		long max2=1;
		long min1=Long.MAX_VALUE;
		long min2=Long.MAX_VALUE;
		for(int i=0;i<n;i++){
			t1.add(Reader.nextLong());
		}
		int m=Reader.nextInt();
		for(int i=0;i<m;i++){
			t2.add(Reader.nextLong());
		}
		
		Collections.sort(t1);
		Collections.sort(t2);
		max1=t1.get(t1.size()-1);
		max2=t2.get(t2.size()-1);
		min1=t1.get(0);
		min2=t2.get(0);
		
		long sum1=0;
		long sum2=0;
		long maxdif=Long.MIN_VALUE;

		long fs1=0;
		long fs2=0;
		
		if(min1>max2){
			fs1=sum(t1,min1-1);
			fs2=sum(t2,min1-1);
			System.out.print(fs1+":"+fs2);
			System.exit(0);
		}
		
		if(min2>max1){
			fs1=sum(t1,0);
			fs2=sum(t2,0);
			System.out.print(fs1+":"+fs2);
			System.exit(0);
		}
	
		long j=0;
		long i=0;
		long prj=j;
		long pri=i;
		long max=0;
		if(max1>max)
			max=max1;
		if(max2>max)
			max=max2;
		long min=Long.MAX_VALUE;
		if(min>min1)
			min=min1;
		if(min>min2)
			min=min2;
		long tempt1=0;
		long tempt2=0;
		for(long d=min-1;d<=max;){
				if(d==min-1){
					sum2=sum(t2,min-1);	
					sum1=sum(t1,min-1);
					if(sum1-sum2>maxdif){
						maxdif=sum1-sum2;
						fs1=sum1;
						fs2=sum2;
					}else if(sum1-sum2==maxdif && sum1>fs1){
						fs1=sum1;
						fs2=sum2;
					}
					d++;
				}else{
					prj=j;
					pri=i;
					j=nextIndex(t2,d,j);
					i=nextIndex(t1,d,i);
					if(i!=t1.size())
						tempt1=t1.get((int)i);
					else
						tempt1=Long.MAX_VALUE;
					if(j!=t2.size())
						tempt2=t2.get((int)j);
					else
						tempt2=Long.MAX_VALUE;
					if(i!=t1.size())
						sum1=sum1-(i-pri);
					else
						sum1=2*t1.size();
					if(j!=t2.size())
						sum2=sum2-(j-prj);
					else
						sum2=2*t2.size();
					if(sum1-sum2>maxdif){
						maxdif=sum1-sum2;
						fs1=sum1;
						fs2=sum2;
					}else if(sum1-sum2==maxdif && sum1>fs1){
						fs1=sum1;
						fs2=sum2;
					}
					if(tempt1>=tempt2)
						d=tempt2;
					else
						d=tempt1;	
				}
			
			
		}
		System.out.print(fs1+":"+fs2);
	}
	
	public static long nextIndex(ArrayList<Long> t,long a,long cur){
		for(long i=cur;i<t.size();i++){
			if(t.get((int)i)>a)
				return i;
		}
		return t.size();
	}
	
	public static long sum(ArrayList<Long> t, long a){
		long sum=0;
		long te=0;
		int count=0;
		for(int i=0;i<t.size();i++){
			te=t.get(i);
			if(te<=a){
				sum+=2;
				count++;
			}else
				break;
		}
		sum+= (t.size()-count)*3;
		return sum;
	}
	
	/** Class for buffered reading int and double values */
	static 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() );
	    }
	}
}
