from collections import deque N = int(input()) T = [[] for _ in range(N)] AB = [tuple(int(x) - 1 for x in input().split()) for _ in range(N - 1)] for a, b in AB: T[a].append(b) T[b].append(a) # dfs dfs_order = [] d = deque([0]) nonvisited = [True] * N nonvisited[0] = False while d: v = d.pop() for x in T[v]: if nonvisited[x]: d.append(x) dfs_order.append((x, v)) nonvisited[x] = False # 子から親へ dp0, dp1 = [0] * N, [0] * N for child, v in reversed(dfs_order): if dp0[child] == len(T[child]) - 1: dp1[v] += 1 else: dp0[v] += 1 # 親から子へ win = set() if not dp1[0]: win.add(0) for child, v in dfs_order: if v in win: dp1[child] += 1 if not dp1[child] and dp1[v] != 1: win.add(child) print(len(win)) if win: print(*sorted(w + 1 for w in win), sep='\n')