#include <bits/stdc++.h> using namespace std; #define rep2(i, n, m) for (int i = (n); i < (m); i++) #define rep(i, n) rep2(i, 0, n) using ll = long long; using vi = vector<int>; void ints(auto& ...ints) { (scanf("%d", &ints), ...); } void lls(auto& ...lls) { (scanf("%lld", &lls), ...); } constexpr int n = 2025; // constexpr int n = 10; ll nC2(ll n) { return n * (n-1) / 2; } pair<vi, ll> steps(ll k) { vi ans; int prv = n; rep(i, n) { ans.push_back(0); while (ans.back() + 1 <= prv && nC2(ans.back()+1) * (i+1) <= k) ans.back()++; if (ans.back() == 1) { ans.pop_back(); break; } prv = ans.back(); k -= nC2(ans.back()) * (i+1); } return pair(ans, k); } void solve() { ll k; lls(k); assert(k <= 4'000'000'000'000); vector<vi> ans; while (k) { auto [v, k2] = steps(k); ans.push_back(v); k = k2; } // for (auto v : ans) printf("%zd ", v.size()); // printf("\n"); vector<string> S; for (auto&& v : ans) { if (!S.empty()) S.push_back(string(n, '#')); S.push_back(string(n, '.')); for (int i : v) { S.push_back(string(i, '.')); S.back().resize(n, '#'); } } assert(S.size() <= n); printf("%zd %d\n", S.size(), n); for (auto&& s : S) printf("%s\n", s.c_str()); } int main() { int t = 1; // ints(t); while (t--) { solve(); } } /* 432143214321 41324312 */