/**
 * This class is a container for a pair of integers.
 */
public class Pair implements Comparable{
   public int   _x1;
   public int 	_x2;
/**
 * 
 */   
   public Pair(int x1, int x2){
	   _x1 = x1;
	   _x2 = x2;
   }
/**
 * 
 */
   public Pair(Pair p){
	   _x1 = p._x1;
	   _x2 = p._x2;
   }
/**
 * 
 */
   public int compareTo(Object p) {
	   Throw.If(!(p instanceof Pair), "illegal Pair comparison");
	   if(_x1 < ((Pair)p)._x1){
			return -1;
	   }else if(_x1 > ((Pair)p)._x1){
			return 1;
	   }else{
			if(	_x2 < ((Pair)p)._x2){
				return -1;
			}else if(_x2 > ((Pair)p)._x2){
				return 1;
			}else{
				return 0;
			}
	   }

	}
 /**
  * 
  */ 
	public String toString(){
       String output = "(" + _x1 + "," + _x2 + ")";
       return output;
	}
   
}
