for (i=0;i<n;++)
for (j=0;j<m;++)
cin>>a[i][j];
n=int(input())
m=int(input())
num = [[int(input()) for i in range(n)] for j in range(m)]
for i in range(0,n):
print("\n")
for j in range(0,m):
print(num[i][j], end=' ')
IndexError: list index out of range
print(num[i][j], end=' ')