N = list(map(int, input().split())) parts = [] for count in range(N[0]): part = list((set(map(int, input().split())))) part.sort(reverse=True) sort_part = part parts.append(part) for list_part in parts: x = ' '.join(map(str, list_part)) print(x)