import numpy as np def convert_str_to_binary(letter: str) -> int: if letter == ".": return 0 if letter == "#": return 1 raise ValueError def convert_bin_to_str(bin: int) -> str: match bin: case 0: return "." case 1: return "#" case _: raise ValueError def main(): R, K = map(int, input().split()) H, W = map(int, input().split()) C = np.array([list(map(convert_str_to_binary, list(input()))) for _ in range(H)]) C = np.rot90(C, k=-R//90) new_C = [] for row in C: new_row = [] for elm in row: new_row.extend([elm]*K) new_C.extend([new_row]*K) for row in new_C: print("".join(map(convert_bin_to_str, row))) if __name__ == "__main__": main()