solve dfs imitate Red and Black