// Scott Dyl
// 7/22/08
// Solution to BHCSI Contest Problem: Donations
import java.util.*;
import java.io.*;

public class donations {

	public static void main(String[] args) throws IOException {

		Scanner fin = new Scanner(new File("donations.in"));

		//first line of program instructs number of donors listed
		int numdonors = fin.nextInt();

		//create three arrays to store first name, last name, and donation for each donor
		String[] fname = new String[numdonors];
		String[] lname = new String[numdonors];
		double[] donation = new double[numdonors];
			
		//fill both arrays with names read from input file
		for(int i=0; i<numdonors; i++) {
			fname[i] = fin.next();
			lname[i] = fin.next();
		}
		
		//fill the donation array with donation amounts read from input file
		for(int i=0; i<numdonors; i++) {
			donation[i] = fin.nextDouble();
		}
		
		//loop through each array together to evaluate data
		for(int i=0; i<numdonors; i++)
			if(donation[i] > 2300) {
				System.out.printf("%s, %c. donated $%.2f\n", lname[i], fname[i].charAt(0), donation[i]);
			}
		fin.close();

	}

}
