N,W,H=map(int,input().split()) print("\n".join(map("".join,zip(*map(f"{{:x>{H}}}".format,(input()+'l'*W).split('l')[:W])))))