//Lisa Soros
//22 July, 2008
//S'mores problem solution

import java.util.*;
import java.io.*;

public class smores
{
	public static void main(String[] args) throws IOException
	{
		Scanner inFile = new Scanner(new File("smores.in"));
		int numStudents = inFile.nextInt();
		String name;
		int numSmores;
		
		for(int x=0; x<numStudents; x++)
		{
			name = inFile.next();
			numSmores = inFile.nextInt();
			System.out.println(name+ " ate "+ numSmores+ " s'mores.");
		}
		
		inFile.close();
	}
}