// Arup Guha
// 10/12/2025
// Solution to 2025 NAQ Problem E: Curling

import java.util.*;

public class curling {

	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
	
		// Store scores here.
		int[] res = new int[2];
		
		// Do 10 rounds.
		for (int i=0; i<10; i++) {
		
			// Store each stone here.
			ArrayList<item> stones = new ArrayList<item>();
			
			// Go through two teams.
			for (int t=0; t<2; t++) {
				
				// Process team t's stones.
				int n = stdin.nextInt();
				for (int j=0; j<n; j++) {
					int x = stdin.nextInt();
					int y = stdin.nextInt();
					int dsq = (x-144)*(x-144)+(y-84)*(y-84);
					stones.add(new item(dsq, t));
				}
			}
			
			// No one gets any points!
			if (stones.size() == 0) continue;
			
			// Sort it!
			Collections.sort(stones);
			
			// Winning team.
			int wT = stones.get(0).team;
			
			// Figure out how many points they get.
			int add = 1;
			int z = 1;
			while (z<stones.size() && stones.get(z).team == wT) {
				add++;
				z++;
			}
			
			// Add this score to the team.
			res[wT] += add;
		}
		
		// Ta da!
		System.out.println(res[0]+" "+res[1]);
	}
}

class item implements Comparable<item> {

	public int dsq;
	public int team;
	
	
	public item(int mydsq, int myt) {
		dsq = mydsq;
		team = myt;
	}
	
	public int compareTo(item other) {
		return this.dsq - other.dsq;
	}
}