#include using namespace std; using ll = long long; #define all(p) p.begin(),p.end() #define rep(i,a,b) for(int i=(int)a;i<(int)b;i++) int main(){ ll H,W,K; cin>>H>>W>>K; K%=(4ll*H*W); vector S(H,vector(W)); int x=0,y=0,dx=1,dy=1; rep(rp,0,K){ S[x][y]=!S[x][y]; if(x+dx==-1||x+dx==H) dx*=-1; else x+=dx; if(y+dy==-1||y+dy==W) dy*=-1; else y+=dy; } rep(i,0,H){ rep(j,0,W) cout<<(S[i][j]?"#":"."); cout<<"\n"; } }