there're equality check, just need father and DFS