import java.lang.Math.*;

public class Point {
  private int x;
  private int y;

  public Point(int x, int y) {
	this.x = x;
	this.y = y;
  }
  
  public int getX() {
	return x;
  }

  public int getY() {
	return y;
  }

  public boolean equals (Object o) {
	if (o instanceof Point) {
	  Point p = (Point) o;
	  return this.x == p.getX() && this.y == p.getY();
	}
	else 
	  return false;
  }

  public double Dist(Point P) {
	return Math.sqrt(Math.pow((P.getX()-this.x),2) + Math.pow((P.getY()-this.y),2));
  }

  public int MDist(Point P) {
	return Math.abs(P.getX()-this.x) + Math.abs(P.getY()-this.y);
  }

  public String toString() {
	return "(" + this.x + ", " + this.y + ")";
  }
}
