""" やるだけ """ import sys from sys import stdin H,W = map(int,stdin.readline().split()) K = int(stdin.readline()) ans = [0] * (H*W) state = [-1 for i in range(4*H*W)] x,y = 0,0 UD = 1 LR = 1 step = 0 while True: step += 1 K -= 1 ans[x*W+y] ^= 1 if UD == 0 and x == 0: UD = 1 elif UD == 1 and x == H-1: UD = 0 elif UD == 0: x -= 1 else: x += 1 if LR == 0 and y == 0: LR = 1 elif LR == 1 and y == W-1: LR = 0 elif LR == 0: y -= 1 else: y += 1 UDLR = 2*UD+LR idx = UDLR*H*W + x*W + y if state[idx] == -1: state[idx] = step else: diff = step - state[idx] K %= 2*diff state[idx] = step if K == 0: break ANS = [ "".join(["#" if ans[i*W+j]==1 else "." for j in range(W)]) for i in range(H)] print (*ANS,sep="\n")