#by taking the user input
def main():
#write your code here
row = int(input())
col = int(input()
#using the list comprehensions
matrix = [[int(input())for j in range(col)]for j in range(row)]
#display the matrix
for i in range(row):
for j in range(col):
print(matrix[i][j],end=" ")
print()
if __name__ == "__main__":
main()
dx = [3, 4, 5, 9]
dy = [5, 3, 2, 1]
output_matrix = []
for dx_n in dx:
dx_row = []
for dy_n in dy:
dx_row.append(dx_n * dy_n)
output_matrix.append(dx_row)
# Output is [[15, 9, 6, 3], [20, 12, 8, 4], [25, 15, 10, 5], [45, 27, 18, 9]]