#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 int main(){ int h,w; cin>>h>>w; long long K; cin>>K; int D; { vector f(h,vector(w,vector(4,0))); int cx = 0,cy = 0; int d = 0; vector dx = {1,-1}; rep(i,Inf32){ f[cx][cy][d] ++; int nx = cx+dx[d&1]; int ny = cy+dx[(d>>1)&1]; if(nx<0||nx>=h){ d ^= 1; } else{ cx = nx; } if(ny<0||ny>=w){ d ^= 2; } else{ cy = ny; } if(cx==0&&cy==0&&d==0){ D = i+1; break; } } } K %= (D*2); { vector f(h,vector(w,vector(4,0))); int cx = 0,cy = 0; int d = 0; vector dx = {1,-1}; rep(i,K){ f[cx][cy][d] ++; int nx = cx+dx[d&1]; int ny = cy+dx[(d>>1)&1]; if(nx<0||nx>=h){ d ^= 1; } else{ cx = nx; } if(ny<0||ny>=w){ d ^= 2; } else{ cy = ny; } if(cx==0&&cy==0&&d==0){ D = i+1; break; } } rep(i,h){ rep(j,w){ int cur =0; rep(k,4){ cur ^= f[i][j][k]; } cur %= 2; if(cur%2==1)cout<<'#'; else cout<<'.'; } cout<