H,W,X = map(int,input().split()) h = (H+1)//2 w = (W+1)//2 if not 2*h+2*w-4<=X<=2*h*w-2: exit(print(-1)) diff = X - (2*h+2*w-4) if diff%4!=0: exit(print(-1)) if w%2==1: ans = [["." for j in range(W)] for i in range(H)] pos = (0,0) rest_dist = X ans[0][0] = "T" while pos!=(H-1,W-1): x,y = pos if rest_dist != (H-1-x) + (W-1-y): if x==0: if (y//2)%2==1: ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) else: ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) elif x==H-1: if (y//2)%2==0: ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) else: ans[x-1][y] = "T" ans[x-2][y] = "T" pos = (x-2,y) elif (y//2)%2==0: ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) else: ans[x-1][y] = "T" ans[x-2][y] = "T" pos = (x-2,y) rest_dist -= 2 else: while pos[1]!=W-1: x,y = pos ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) while pos[0]!=H-1: x,y = pos ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) stack = [(i,j) for i in range(H) for j in range(W) if ans[i][j]=="T" and i%2==0 and j%2==0] while stack: x,y = stack.pop() if x+2<=H-1 and ans[x+2][y]!="T": ans[x+2][y] = "T" ans[x+1][y] = "T" stack.append((x+2,y)) if 2<=x and ans[x-2][y]!="T": ans[x-2][y] = "T" ans[x-1][y] = "T" stack.append((x-2,y)) if y+2<=W-1 and ans[x][y+2]!="T": ans[x][y+2] = "T" ans[x][y+1] = "T" stack.append((x,y+2)) if 2<=y and ans[x][y-2]!="T": ans[x][y-2] = "T" ans[x][y-1] = "T" stack.append((x,y-2)) for i in range(H): for j in range(W): if ans[i][j]=="T": ans[i][j]="." else: ans[i][j]="#" print("".join(ans[i])) elif h%2==1: H,W = W,H h,w = w,h ans = [["." for j in range(W)] for i in range(H)] pos = (0,0) rest_dist = X ans[0][0] = "T" while pos!=(H-1,W-1): x,y = pos if rest_dist != (H-1-x) + (W-1-y): if x==0: if (y//2)%2==1: ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) else: ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) elif x==H-1: if (y//2)%2==0: ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) else: ans[x-1][y] = "T" ans[x-2][y] = "T" pos = (x-2,y) elif (y//2)%2==0: ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) else: ans[x-1][y] = "T" ans[x-2][y] = "T" pos = (x-2,y) rest_dist -= 2 else: while pos[1]!=W-1: x,y = pos ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) while pos[0]!=H-1: x,y = pos ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) stack = [(i,j) for i in range(H) for j in range(W) if ans[i][j]=="T" and i%2==0 and j%2==0] while stack: x,y = stack.pop() if x+2<=H-1 and ans[x+2][y]!="T": ans[x+2][y] = "T" ans[x+1][y] = "T" stack.append((x+2,y)) if 2<=x and ans[x-2][y]!="T": ans[x-2][y] = "T" ans[x-1][y] = "T" stack.append((x-2,y)) if y+2<=W-1 and ans[x][y+2]!="T": ans[x][y+2] = "T" ans[x][y+1] = "T" stack.append((x,y+2)) if 2<=y and ans[x][y-2]!="T": ans[x][y-2] = "T" ans[x][y-1] = "T" stack.append((x,y-2)) for i in range(H): for j in range(W): if ans[i][j]=="T": ans[i][j]="." else: ans[i][j]="#" rev = [[ans[j][i] for j in range(H)] for i in range(W)] for i in range(W): print("".join(rev[i])) else: ans = [["." for j in range(W)] for i in range(H)] pos = (0,0) rest_dist = X ans[0][0] = "T" while pos!=(H-1,W-1): x,y = pos if rest_dist != (H-1-x) + (W-1-y): if y==W-3: if (x//2)%2==0: ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) else: ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) elif y==W-1: if (x//2)%2==0: ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) else: ans[x][y-1] = "T" ans[x][y-2] = "T" pos = (x,y-2) else: if x==0: if (y//2)%2==1: ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) else: ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) elif x==H-1: if (y//2)%2==0: ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) else: ans[x-1][y] = "T" ans[x-2][y] = "T" pos = (x-2,y) elif (y//2)%2==0: ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) else: ans[x-1][y] = "T" ans[x-2][y] = "T" pos = (x-2,y) rest_dist -= 2 else: if y==W-3: if (x//2)%2==0: while pos[0]!=H-1: x,y = pos ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) while pos[1]!=W-1: x,y = pos ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) else: while pos[0]!=H-1: x,y = pos ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) while pos[1]!=W-1: x,y = pos ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) elif y==W-1: while pos[1]!=W-1: x,y = pos ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) else: while pos[1]!=W-1: x,y = pos ans[x][y+1] = "T" ans[x][y+2] = "T" pos = (x,y+2) while pos[0]!=H-1: x,y = pos ans[x+1][y] = "T" ans[x+2][y] = "T" pos = (x+2,y) stack = [(i,j) for i in range(H) for j in range(W) if ans[i][j]=="T" and i%2==0 and j%2==0] while stack: x,y = stack.pop() if x+2<=H-1 and ans[x+2][y]!="T": ans[x+2][y] = "T" ans[x+1][y] = "T" stack.append((x+2,y)) if 2<=x and ans[x-2][y]!="T": ans[x-2][y] = "T" ans[x-1][y] = "T" stack.append((x-2,y)) if y+2<=W-1 and ans[x][y+2]!="T": ans[x][y+2] = "T" ans[x][y+1] = "T" stack.append((x,y+2)) if 2<=y and ans[x][y-2]!="T": ans[x][y-2] = "T" ans[x][y-1] = "T" stack.append((x,y-2)) for i in range(H): for j in range(W): if ans[i][j]=="T": ans[i][j]="." else: ans[i][j]="#" print("".join(ans[i]))