def dfs(n): if n == 1: return 1 if v[fa[n-2]-1] < v[n-1]: return dfs(fa[n-2]) else: return n res = [1] for i in range(n-1): res.append(dfs(i+2)) print(' '.jo...