#include <bits/stdc++.h> using namespace std; //#define int long long typedef long long ll; typedef long double ld; const ll n = 2025; int ans[n][n]; ll k; void solve() { cin >> k; ll w0 = 1; while ((w0 + 1) * w0 / 2 * (w0 + 1) * w0 / 2 <= k) ++w0; for (int i = 0; i < w0; ++i) { for (int j = 0; j < w0; ++j) { ans[i][j] = 1; } } k -= (w0 - 1) * w0 / 2 * (w0 - 1) * w0 / 2; ll can_ones = (n - w0) / 3 * ((n + 1) / 3); ll curr_x = w0; ll curr_y = 0; while (k > can_ones && curr_x < n) { if (ans[curr_x - 1][curr_y] == 0) { if (k >= curr_x - curr_y && (curr_x == 1 || ans[curr_x - 2][curr_y] == 1)) { ans[curr_x - 1][curr_y] = 1; ans[curr_x][curr_y - 1] = 0; k -= curr_x - curr_y; --curr_y; } else { curr_x += 1; curr_y = 0; } } else { if (k >= curr_x * curr_y) { k -= curr_x * curr_y; ans[curr_x][curr_y] = 1; ++curr_y; if (curr_y >= w0) { curr_x += 1; curr_y = 0; } } else { curr_x += 1; curr_y = 0; } } } assert(k <= can_ones); curr_x = 0; curr_y = w0 + 1; while (k > 0 && curr_y + 1 < n) { if (curr_x + 1 >= n) { curr_y += 3; curr_x = 0; } else { k -= 1; ans[curr_x][curr_y] = 1; ans[curr_x + 1][curr_y] = 1; ans[curr_x][curr_y + 1] = 1; ans[curr_x + 1][curr_y + 1] = 1; curr_x += 3; } } assert(k == 0); cout << n << " " << n << "\n"; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { if (ans[i][j]) { cout << "#"; } else { cout << "."; } } cout << "\n"; } } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifdef LC freopen("/home/team11/CLionProjects/contest/input.txt", "r", stdin); freopen("/home/team11/CLionProjects/contest/output.txt", "w", stdout); #endif int t= 1 ; // cin >> t; for (int tt =0; tt <t; tt++) { solve(); } return 0; }