#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #define all(x) begin(x), end(x) #define sz(x) int((x).size()) using ll = long long; using pii = pair<int, int>; using vi = vector<int>; #ifdef LOCAL auto operator<<(auto& o, auto x) -> decltype(x.first, o); auto operator<<(auto& o, auto x) -> decltype(x.end(), o) { o << "{"; for (int i = 0; auto y : x) o << ", " + !i++ * 2 << y; return o << "}"; } auto operator<<(auto& o, auto x) -> decltype(x.first, o) { return o << "(" << x.first << ", " << x.second << ")"; } void __print(auto... x) { ((cerr << x << " "), ...) << endl; } #define debug(x...) __print("[" #x "]:", x) #else #define debug(...) 2137 #endif const int start = 2025; #warning TODO change __int128 bin(ll n) { return n * (n - 1) / 2; } pair<vector<string>, ll> f(int bb, ll left) { ll n = start; vector<string> v(start, string(start, '#')); int cur = 0; while(n >= 2) { ll k = 1; if(n <= bb) { __int128 bn = bin(n); while(cur + k - 1 <= start && bn * bin(k) <= left) k++; k--; if(k >= 2) { debug(bb, n, k, cur, left); cur += k; if(cur < start) { for(int j = 0; j < n; j++) { v[j][cur] = '.'; } } cur++; left -= bn * bin(k); } } for(int j = cur; j < v[0].size(); j++) { v[n - 1][j] = '.'; } if(n == 2) { for(int j = cur; j < v[0].size(); j++) { v[0][j] = '.'; } } n--; } debug(bb, left); return {v, left}; } int main() { cin.tie(0)->sync_with_stdio(0); ll left; cin >> left; vector<string> ans; ll mn = 1e18; int id = 0; for(int x = start - 10; x <= start - 2; x++) { auto [v, lt] = f(x, left); if(lt < mn) { mn = lt; id = x; ans = v; } } left = mn; int cur = start - 1; while(left) { ll k = 2; while(bin(k) <= left) k++; k--; debug(cur - k + 1, k, left - (ll) bin(k)); for(int i = cur - k + 1; i <= cur; i++) { for(int j = start - 2; j < start; j++) ans[i][j] = '#'; } cur -= k + 1; left -= bin(k); } cout << ans.size() << " " << ans[0].length() << endl; for(int i = 0; i < ans.size(); i++) { cout << ans[i] << '\n'; } debug(mn, left, id); // cerr << mn << " " << id << endl; }