H,W = map(int,input().split()) K = int(input()) S = [[0] * W for _ in range(H)] def turn(k): x, y = 0, 0 dx, dy = 1, 1 cycle = 0 cnt = 0 flag = 1 while flag and cycle < k: cycle += 1 S[x][y] ^= 1 #print(x,y,S[x][y]) if S[x][y] == 1: cnt+= 1 else: cnt -= 1 if cnt == 0: flag = 0 if dx == 1: if x < H - 1: x += 1 else: dx = -1 else: if x > 0: x -= 1 else: dx = 1 if dy == 1: if y < W - 1: y += 1 else: dy = -1 else: if y > 0: y -= 1 else: dy = 1 return cycle c = turn(K) #print(c) turn(K % c) for i in range(H): print("".join(["." if s == 0 else "#" for s in S[i]]))