import java.util.ArrayList;
import java.util.Scanner;

// Name:

// Date:


public class SkiRace {

	// state
	private ArrayList<Skier> mySkiers; 
	
	
	// constructor - reads in skiers names and race numbers
	public SkiRace(Scanner input)
	{   
		mySkiers = new ArrayList<Skier>();
		// TODO - finish below here
		while (input.hasNext())
		{
		
		}
	}
	
	// For each skier, generate a race time and set it as the new time if it
	//     is a faster time
	public void skiRound()
	{
		// TO DO
		
		
		
		
	}
	
	// Print the name of the skier with the best time. If there
	// is a tie, then print all such names with that time.
	public void PrintNamesWithBestSkiTimes()
	{
		// compute min time > 0
		int minRaceTime = 1001;
		for (Skier current : mySkiers)
		{
		    int	currentTime = current.getTime();
                    if (currentTime < minRaceTime)
		    {
		    	minRaceTime = currentTime;
		    }
		}
		
		// Print names of those with minimum race time
		for (Skier current: mySkiers)
		{
			if (current.getTime() == minRaceTime)
				System.out.println(current.getName());
		}
	}
	public void PrintNamesWithBestSkiTimes2()
	{
		// compute min time > 0
		int minRaceTime = mySkiers.get(0).getTime();
		String result = "";
		for (Skier current : mySkiers)
		{
		    int	currentTime = current.getTime();
                    if (currentTime < minRaceTime)
		    {
		    	minRaceTime = currentTime;         // new fast time
		    	result = current.getName();        // get first name
		    }
                    else if (currentTime == minRaceTime)
                    {
                       result += " " + current.getName(); // another with same time
                    }
		}
				System.out.println(result);
		
	}
	
	// Print the name, number and best times of all skiers. 
	// If a skier has not skied yet, then print 0 for their time.
	public void printResults()
	{
		// TO DO
		
		
		
		
		
		
	}
	
	
}
