codeforces 589H - Tourist Guide(dfs)