public class Pair<Element>{
  private Element first;
  private Element second;
  
  public Pair(Element first, Element second){
    this.first = first;
    this.second = second;
  }
  
  public Element getFirst() { return first; }
  public Element getSecond(){ return second;}
  
  public void swap(){
    Element temp;
    temp = first;
    first = second;
    second = temp;
  }
  
  public String toString(){
    return "[" + getFirst() + ", " + getSecond() + "]";
  }
}
