#include <bits/stdc++.h> using namespace std; #define int long long constexpr int SZ = 2025; int calc(int n, int m){ return (n*m)*(n*m-n-m+1)/4; } int32_t main(){ int k;cin>>k; vector<pair<int,int>> rect; for (int i = SZ; i >= 2 && !rect.size(); i--){ for (int j = SZ; j >= 2 && !rect.size(); j--){ if (calc(i, j)<=k){ rect.push_back({j,i}); k-=calc(i,j); break; } } } while (k > 0){ for (int i = SZ - rect[0].first - 1; i >= 2; i--){ for (int j = SZ; j >= 2; j--){ if (calc(i, j) <= k){ k -= calc(i, j); rect.push_back({i, j}); goto mahmut; } } } mahmut:; } cout<<SZ<<" "<<SZ<<endl; vector<string> ans(SZ, string(SZ,'.')); for (int i = 0; i < rect[0].first; i++){ for (int j = 0; j < rect[0].second; j++){ ans[i][j]='#'; } } int yuk = rect[0].first + 1; int pref = 0; for (int k = 1; k < rect.size(); k++){ for (int i = 0; i < rect[k].first; i++){ for (int j = 0; j < rect[k].second; j++){ assert(i+yuk < SZ && pref + j < SZ); ans[i+yuk][pref+j]='#'; } } pref += rect[k].second + 1; } for (int i = 0; i < SZ; i++) { cout<<ans[i]<<'\n'; } }