import java.util.HashSet;
import java.util.Set;
class Pos{
public int i;
public int j;
public Pos(int i,int j){
this.i=i;
this.j=j;
}
public int hashCode(){
return i*100+j;
}
public boolean equals(Object x){
if(x instanceof Pos){
Pos p=(Pos)x;
return p.i==i&&p.j==j;
}
return false;
}
}
@SuppressWarnings("unchecked")
public class Maze {
private char[][] data;
private Pos entry;
private Pos exit;