#include using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) template bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;} template bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;} const long long mod=998244353; const long long mod2=469762049; const long long mod100=1000000007; struct point{ int r,c; }; int main(){ cout.tie()->sync_with_stdio(0); cin.tie(0); int N,K;cin>>N>>K; point s,t; cin>>s.r>>s.c>>t.r>>t.c; int A[N+1][N+1]; for(int i=1;i<=N;i++){ for(int j=1;j<=N;j++){ A[i][j]=(i+j)%2; } } //0->白、1->黒 if(A[s.r][s.c]==1){ for(int i=1;i<=N;i++){ for(int j=1;j<=N;j++){ A[i][j]^=1; } } } if(A[t.r][t.c]==1){ A[t.r][t.c]=0; } int d=abs(s.r-t.r)+abs(s.c-t.c); int maximum=d+(d/2)*2; if(maximumK){ cout<<-1<t.r) p=-1; s.r+=p; if(A[s.r][s.c]==1 && cnt>0){ A[s.r][s.c]=0; cnt--; } } while(s.c!=t.c){ int p=1; if(s.c>t.c) p=-1; s.c+=p; if(A[s.r][s.c]==1 && cnt>0){ A[s.r][s.c]=0; cnt--; } } for(int i=1;i<=N;i++){ for(int j=1;j<=N;j++){ if(A[i][j]) cout<<"#"; else cout<<"."; } cout<