m,n = input().split() m = int(m) n = int(n) a = [] #1维 for x in range(m): b = input().split() a.append( b[::-1] ) for row in a: print(*row)