n,k=map(int,input().split()) L=[input() for _ in range(n)] for s in L: tmp=[] for e in s: for _ in range(k): tmp.append(e) print("".join(tmp))