#include <bits/stdc++.h> #define all(x) x.begin(), x.end() #define len(x) (int)(x.size()) #define mp make_pair #define pb push_back #define fi first #define se second using namespace std; typedef pair<int, int> pii; typedef long long ll; typedef long double ld; bool umin(int& a, int b) { if(b < a) { a = b; return true; } return false; } template<typename T> bool umax(T& a, T b) { if(b > a) { a = b; return true; } return false; } //#ifdef KoRoVa //#define DEBUG for (bool __DEBUG=1;__DEBUG;__DEBUG=0) //#define LOG(...) prnt(#__VA_ARGS__" ::",__VA_ARGS)<<endl //#else //#define DEBUG while(false) //#define LOG(...) if(false) //#endif template <class ...Ts> auto &prnt(Ts ...ts) { return ((cerr << ts << " "), ...); } const int max_n = -1, inf = 1000111222; const ll linf = 1000111222000111222; ll f (ll i) { ll a = i * i * (i * i - i - i + 1); assert(a % 4 == 0); a /= 4; return a; } ll gg (ll n, ll m) { ll a = n * m * (n * m - n - m + 1); assert(a % 4 == 0); a /= 4; return a; } ll save_area; int H; inline int get_mx (ll k) { int save = -1, h = -1; ll mx = 0; for (int i = 2; i <= 2025; i++) { for (int j = 2; j <= i; j++) { ll now = gg(i, j); if (now <= k) { if (umax(mx, now)) { h = i; save = j; } } } } H = h; save_area = mx; return save; } inline ll can (ll k) { int need = 0; while (k) { int x = get_mx(k); k -= save_area; bool ok = false; ll can = (H + 1) / 3; ll cnt = min(can, k / x); k -= cnt * x; need += x + 1; if (cnt) { ++need; } } return need; } void test_case() { ll k = 4e12; // cin >> k; for (int it = 0; it < 10000; it++) { ll gg = can(k - it); // cerr << gg << '\n'; assert(gg <= 2025); } } inline void solve (ll k) { if (k == 0) { cout << "1 1\n"; cout << ".\n"; return; } int need = 0; vector<vector<ll> > ans; while (k) { int x = get_mx(k); k -= save_area; bool ok = false; ll can = (H + 1) / 3; ll cnt = min(can, k / x); k -= cnt * x; need += x + 1; if (cnt) { ++need; } ans.pb({H, x, cnt}); } vector<string> a(2025, string(need, '.')); int id = 0; // cerr << "here" << endl; for (auto &i : ans) { int n = i[0]; int m = i[1]; for (int x = 0; x < n; x++) { for (int y = 0; y < m; y++) { a[x][y + id] = '#'; } } int add = i[2]; id += m; for (int x = 0, s = 0; x < add; x++, s += 3) { a[s][id] = '#'; a[s + 1][id] = '#'; } ++id; if (add) { ++id; } } cout << 2025 << ' ' << need << '\n'; for (auto &i : a) { cout << i << '\n'; } } signed main() { // freopen("input.txt", "r", stdin); ios_base::sync_with_stdio(false); cin.tie(nullptr); int testcases = 1; ll k; cin >> k; solve(k); // cin >> testcases; // while(testcases--) test_case(); exit(0); }