// Garrett King
// 7/26/2010
// Edited by Arup Guha to fit the edited problem specification.

import java.io.*;
import java.util.*;

public class golf {
	
	public final static int NUM_HOLES = 18;
	
	public static void main(String[] args) throws FileNotFoundException
	{
		File filename = new File("golf.in");
		Scanner fin = new Scanner(filename); 
		
		int numRounds = fin.nextInt();
		
		// Go through each round.
		for (int round=1; round<=numRounds; round++) {
			
			System.out.println("Golf round "+round+":");
		
			int winner = 0;
			int winningpar = 0;
			int par = 0;
			
			for(int i = 0; i < NUM_HOLES; i++)
			{
				par += fin.nextInt();
			}
		
			int players = fin.nextInt();
		
			// Go through each player.
			for(int i = 1; i <= players; i++)
			{
				// Figure out this player's score.
				int playerscore = 0;
				for(int j = 0; j < NUM_HOLES; j++)
				{
					int score = fin.nextInt();
					playerscore += score;
				}
			
				// Player's score in relation to par.
				int totalpar = playerscore - par;
			
				// Output this player's score.
				if(totalpar < 0)
				{
					System.out.println("Player " + i + " scored "+(-totalpar)+" stroke(s) below par.");
				}
				else if(totalpar > 0)
				{
					System.out.println("Player " + i + " scored "+totalpar+" stroke(s) above par.");
				}
				else 
				{
					System.out.println("Player " + i + " scored exactly par.");
				}
			
				// Replace our player if it's the first or best we've seen.
				if(i == 1 || totalpar < winningpar)
				{
					winner = i;
					winningpar = totalpar;
				}
			
				
			}
		
			System.out.println("Player " + winner + " won the game with a score of " + winningpar+".");
			System.out.println();
			
		} // end-round
		
	}
	
}
