import sequtils, strutils var n = readLine(stdin).parseInt m = readLine(stdin).parseInt pq:seq[seq[int]] = @[] for i in 0..