from math import gcd H, W = map(int, input().split()) K = int(input()) lcm = H * W // gcd(H, W) K %= 2 * lcm x, y = 0, 0 G = [[0] * W for i in range(H)] def plot(G, x, y): x %= 2 * H y %= 2 * W if x >= H: x = 2 * H - 1 - x if y >= W: y = 2 * W - 1 - y G[x][y] = 1 - G[x][y] for _ in range(K): plot(G, x, y) x, y = x + 1, y + 1 def f(c): return "#" if c else "." for i in range(H): ans = list(map(f, G[i])) print(*ans, sep="")