data = """2 3 4 5 6 3
1 2 2 4 5 5
1 2 2 2 2 4
""".splitlines()
[int(x) for line in data for x in line.split()]
[[int(i) for i in line.split()] for line in data]
list comprehension replace for loop in 2D matrix