public int CompareTo(object obj) { Point p = (Point)obj; return(x == p.x ? y.CompareTo(p.y) : x.CompareTo(p.x)); }