If there isn't a valid structure, output "Invalid". Otherwise, you need to output all the M roads in M lines. A road is a pair "A B" meaning there is a road between city A and city B (0 <= A, B < N, A != B). If there are more than one valid structure, you should output the lexicographically smallest list of roads. A list of roads R [R1, R2, ... RM] is lexicographically smaller than Q [Q1, Q2, ... QM] if R contains a smaller road at the first index where they differ. A road "A B" is smaller than the road "C D" if A < C or A = C and B < D.