// 対称性をなんとかする, 対角線ごとに考える #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)); rep(i, n) { rep(j, n) { int p = (i + j) - (sx + sy); if ((sx + sy) % 2 == (i + j) % 2 || (i + j) == (tx + ty)) { black[i][j] = false; } else if (0 <= p && p < L && p % 2 == 1) { black[i][j] = true; } else { black[i][j] = false; } } } rep(i, n) { rep(j, n) { if (black[i][j]) cout << "#"; else cout << "."; } cout << endl; } return 0; }