import java.util.*;
public class Point implements Comparable<Point>{
	int x, y;
	public Point(int x, int y){
		this.x=x;
		this.y=y;
	}
	public int getX(){
		return x;
	}
	public int getY(){
		return y;
	}
	public void setX(int x){
		this.x=x;
	}
	public void setY(int y){
		this.y=y;
	}
	@Override
	public String toString(){
		return "("+x+", "+y+")";
	}
	@Override
	public int hashCode(){
		return Objects.hash(x,y);
	}
	@Override
	public boolean equals(Object obj){
		if(obj==null){return false;}
		if(this==obj){return true;}
		if(this.getClass() != obj.getClass()){return false;}
		if(((Point)obj).getX()==this.x &&((Point)obj).getY()==this.y){return true;}
		return false;
	}
	@Override
	public int compareTo(Point other){
		if(this.equals(other)){return 0;}
		//ha az első paraméter (this) a nagyobb, mint a paraméterben kapott, akkor adjunk vissza 1-t; fordított esetben pedig -1-et
		//két pont közül az a kisebb, amelynek az x koordinátája kisebb; azonos x koordinátánál az y koordináta dönt
		if(other.getX()<this.x){
			return -1;
		}
		if(other.getX()==this.x && other.getY()<this.y){
			return -1;
		}
		return 1;
	}
}