import java.io.*;
import java.util.*;
class Pair
{
private int x, y;
public Pair(int x, int y)
{
this.x = x;
this.y = y;
}
public int x() {
return this.x;
}
public int y() {
return this.y;
}
public boolean equals(Object o)
{
if (o == this)
return true;
if (!(o instanceof Pair))
return false;
Pai