#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) // https://github.com/shingo0909/kyopro/blob/39029fab39c1735c38e5e9e4494d9934f81d6918/Library/GridBFS.cpp struct GridBFS { private: int H, W; vector grid; vector> d; static constexpr ll INF = 1LL << 62; static constexpr int dx[] = {0, 0, 1, -1}; static constexpr int dy[] = {1, -1, 0, 0}; public: GridBFS(vector &grid) : H(grid.size()), W(grid[0].size()), grid(grid) {} void bfs(int sx, int sy) { d.assign(H, vector(W, INF)); queue> q; d[sx][sy] = 0; q.push({sx, sy}); while (!q.empty()) { auto [x, y] = q.front(); q.pop(); for (int dir = 0; dir < 4; dir++) { int nx = x + dx[dir]; int ny = y + dy[dir]; if (nx < 0 || nx >= H || ny < 0 || ny >= W) continue; if (grid[nx][ny] == '#') continue; if (d[nx][ny] != INF) continue; d[nx][ny] = d[x][y] + 1; q.push({nx, ny}); } } } ll dist(int x, int y) const { return d[x][y] == INF ? -1 : d[x][y]; } }; int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int n; cin >> n; // rep(i, 1 << (n * n)) { // vector s(n); // rep(j, n * n) { // if (i >> j & 1) { // s[j / n].push_back('#'); // } else // s[j / n].push_back('.'); // } // if (s[0][0] == '#' || s.back().back() == '#') // continue; // bool ok = true; // rep(l, n - 1) rep(r, n) { // if (l == 0 || l >= r) // continue; // for (int k = l; k < r; k++) { // rep(x, n) s[k][x] = (s[k][x] == '#') ? '.' : '#'; // } // GridBFS g(s); // g.bfs(0, 0); // if (g.dist(n - 1, n - 1) == -1) { // ok = false; // } // for (int k = l; k < r; k++) { // rep(x, n) s[k][x] = (s[k][x] == '#') ? '.' : '#'; // } // } // auto t = s; // rep(i, n) rep(j, n) s[j][i] = t[i][j]; // rep(l, n - 1) rep(r, n) { // if (l == 0 || l >= r) // continue; // for (int k = l; k < r; k++) { // rep(x, n) s[k][x] = (s[k][x] == '#') ? '.' : '#'; // } // GridBFS g(s); // g.bfs(0, 0); // if (g.dist(n - 1, n - 1) == -1) { // ok = false; // } // for (int k = l; k < r; k++) { // rep(x, n) s[k][x] = (s[k][x] == '#') ? '.' : '#'; // } // } // if (ok) { // for (string t : s) // cout << t << endl; // cout << endl; // } // } rep(i, n) { rep(j, n) { if (abs(n - i - 1 - j) <= 1) cout << '#'; else cout << '.'; } cout << endl; } return 0; }