import java.util.*;

/** A max heap of times, with associated names for each time value. */
public class TimeHeap {
  /** A single (time,name) entry in the heap.
   * Note that when you are doing heap operations, you will be comparing
   * the "time" field in each entry.
   */
  private class Entry {
    public long time;
    public String name;
    public Entry(long time, String name) {
      this.time = time;
      this.name = name;
    }
  }

  // TODO: An array or ArrayList to store your heap
  // Perhaps you also want to store the size?

  /** Creates a new, empty heap. */
  public TimeHeap() {
    // TODO: initialize your heap with size 0
    // (hint: the array or arraylist should NOT be empty!)
  }

  /** Returns the number of entries in the heap */
  public int size() {
    return 0; // TODO; this return value should be fixed!
  }

  /** Inserts a new time and corresponding name to the heap. 
   * You can assume the name is not null. */
  public void insert(long time, String name) {
    // TODO
  }

  /** Removes the entry with the largest time, and returns the
   * corresponding name.
   */
  public String removeMax() {
    if (size() < 1) {
      throw new NoSuchElementException("heap is empty");
    }

    return null; // TODO; this return value should be fixed!
  }
}
