# 制約確認 from collections import deque, defaultdict as dd from copy import deepcopy from heapq import heappop, heappush, heappushpop, heapify from random import randint, seed, shuffle, choice, choices, sample from time import time INF = 1 << 60 MOD = 998244353 class Unionfind: def __init__(self, num): self.num = num self.parents = [-1for _ in range(num)] def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) return self.parents[x] def union(self, x, y): x = self.find(x) y = self.find(y) if x == y: return if self.find(x) > self.find(y): x, y = y, x self.parents[x] += self.parents[y] self.parents[y] = x def size(self, x): return -self.parents[self.find(x)] def same(self, x, y): return self.find(x) == self.find(y) def main(): n, u, v = map(int, input().split()) e = [list(map(int, input().split())) for _ in range(n-1)] assert 3 <= n <= 100000 assert 1 <= u < v <= n-1 uf = Unionfind(n) for u, v in e: assert 1 <= u < v <= n if uf.same(u-1, v-1): assert 1 < 0 uf.union(u-1, v-1) def no(): print(n, s, t) for i in range(m - 1): print(i + 1, i + 2) for i in range(m, n): print(randint(2, m - 1), i + 1) def nso(): with open("output.txt", "w") as f: print(n, s, t, file=f) for i in range(m - 1): print(i + 1, i + 2, file=f) for i in range(m, n): print(randint(2, m - 1), i + 1, file=f) if __name__ == "__main__": main()