def read_lines(): try: line = input() while line: yield line line = input() except EOFError: pass def read_matrix(): return [[int(x) for x in line.split()] for line in read_lines()] a = read_matrix() print(a) b = read_matrix() print(b)
1 2 3 4 5 6 7 8 9 0 1 2