// 対称性をなんとかする #include #include #include #define rep(i, n) for(i = 0; i < n; i++) using namespace std; int main() { int n, K; int sy, sx, ty, tx; cin >> n >> K; cin >> sy >> sx >> ty >> tx; sy--; sx--; ty--; tx--; bool flip = false; if (sy > ty) { swap(sx, tx); swap(sy, ty); } if (sx > tx) { flip = true; swap(sx, tx); } int d = (ty - sy) + (tx - sx); int L = K - d; if (L < 0 || L > d || L % 2 != 0) { cout << -1 << endl; return 0; } int i, j; vector> black(n, vector(n, true)); for (i = sy; i <= ty; i++) for (j = sx; j <= tx; j++) black[i][j] = false; for (i = sy; i <= ty; i++) { for (j = sx; j <= tx; j++) { int p = (i - sy) + (j - sx); if (p % 2 == 1 && p < L) { black[i][j] = true; } } } if (flip) { rep(i, n) { int l = 0, r = n - 1; while (l < r) { swap(black[i][l], black[i][r]); l++; r--; } } } rep(i, n) { rep(j, n) { if (black[i][j]) cout << "#"; else cout << "."; } cout << endl; } return 0; }