import java.io.*;
import java.util.*;

public class Roster
{
	private ArrayList allPlayers;
	
	public Roster(BufferedReader file) throws IOException
	{
		allPlayers = new ArrayList();
		String line;

		while ((line = file.readLine()) != null)
		{
			StringTokenizer sTok = new StringTokenizer(line);
			String first = sTok.nextToken();
			String last = sTok.nextToken();
			double ht = Double.parseDouble(sTok.nextToken());
			int wt = Integer.parseInt(sTok.nextToken());
			boolean meds = new Boolean(sTok.nextToken()).booleanValue();
			String gender = sTok.nextToken();
			String sport = sTok.nextToken();
			if (sport.equals("volleyball"))
			{
				int assists = Integer.parseInt(sTok.nextToken());
				int digs = Integer.parseInt(sTok.nextToken());
				int kills = Integer.parseInt(sTok.nextToken());
				allPlayers.add(new VballPlayer(first,last,ht,wt,meds,gender,sport,assists,digs,kills));
			}
			else if (sport.equals("soccer"))
			{
				int assists = Integer.parseInt(sTok.nextToken());
				int goals = Integer.parseInt(sTok.nextToken());
				allPlayers.add(new SoccerPlayer(first,last,ht,wt,meds,gender,sport,assists,goals));
			}
		}
		file.close();
	}
	
	public void printRoster(String sp)
	{
		for (int i = 0; i < allPlayers.size(); i++)
		{
			if (((Athlete)allPlayers.get(i)).getSport().equals(sp))
				((Athlete)allPlayers.get(i)).printInfo();
		}		
	}
	
	public void printStats(String sp)
	{
		for (int i = 0; i < allPlayers.size(); i++)
		{
			Athlete a = (Athlete)allPlayers.get(i);
			if (a.getSport().equals(sp))
				a.displayStats();
		}		
	}
}

