#pragma GCC optimize("Ofast") #pragma GCC optimize("O3,unroll-loops") #include <bits/stdc++.h> using namespace std; using ll = long long; // #define int ll using pii = pair<int, int>; mt19937 rnd(42); const ll M = 4e12 + 1; char a[2028][2028]; const int N = 2025; int CNT= 0; bool try_place(int n, int m) { for (int i = 0; i + n <= N; i++) { for (int j = 0; j + m <= N; j++) { bool g = 1; for (int x = 0; x < n && g; x++) { for (int y = 0; y < m && g; y++) { // CNT++; if (a[i + x][j + y] != '?') g = 0; } } if (g == 0) continue; for (int x = 0; x <= n; x++) { for (int y = 0; y <= m; y++) { if (x == n || y == m) a[i + x][j + y] = '.'; else a[i + x][j + y] = '#'; // CNT++; } } return true; } } return false; } pair<ll, pii> all[N * N]; void solve() { ll k = 5; cin >> k; int n = 2025; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) a[i][j] = '?'; } int t = 0; for (int i = 1; i <= n; i++) { for (int j = i; j <= n; j++) { ll cur = i * j * (i - 1) * (j - 1) / 4; if (cur <= k) all[t++] = {cur, {i, j}}; } } // cerr << all.size() << endl; int cnt = 0; sort(all, all + t, greater()); for (int i = 0; i < t; i++) { auto [v, px] = all[i]; if (k == 0) break; while (k >= v) { if (!try_place(px.first, px.second) && !try_place(px.second, px.first)) break; k -= v; cnt++; } } // cout << cnt << " " << k << " " << CNT << endl; // CNT = 0; cout << 2025 << " " << 2025 << endl; for (int i = 0; i < 2025; i++) { for (int j = 0; j < 2025; j++) { if (a[i][j] == '?') a[i][j] = '.'; cout << a[i][j]; } cout << "\n"; } // for (int i = 0; i < 10; i++) { // for (int j = 0; j < 10; j++) { // if (a[i][j] == '?') // a[i][j] = '.'; // cout << a[i][j]; // } // cout << "\n"; // } } int32_t main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int tt = 1; // cin >> tt; for (int t = 0; t < tt; t++) { solve(); } return 0; }