#include #include #include #include #include #include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; template vector> vec2d(int n, int m, T v){ return vector>(n, vector(m, v)); } template vector>> vec3d(int n, int m, int k, T v){ return vector>>(n, vector>(m, vector(k, v))); } template void print_vector(vector v, char delimiter=' '){ if(v.empty()) { cout << endl; return; } for(int i = 0; i+1 < v.size(); i++) cout << v[i] << delimiter; cout << v.back() << endl; } int f(int n){ static bool ok[500]; static int memo[500]; if(n == 1) return 1; if(n == 2) return 2; if(n == 3) return 3; if(ok[n]) return memo[n]; int l = n/2; int r = n-l; memo[n] = r+1+f(l)+f(r); ok[n] = true; return memo[n]; } vector solve(int n){ static bool ok[500]; static vector memo[500]; if(n == 1){ return {"."}; } if(n == 2){ return {"..", ".."}; } if(n == 3){ return {"...", "...", "..."}; } if(ok[n]) return memo[n]; int l = n/2; auto ans_l = solve(l); int r = n-l; auto ans_r = solve(r); int h = l+1+ans_l.size()+ans_r.size(); int w = r+1+ans_l[0].size()+ans_r[0].size(); vector ans(h, string(w, '#')); for(int i = 0; i < l+1; i++){ for(int j = 0; j < r+1; j++){ ans[i][j] = '.'; } } int s = l+1, t = r+1; ans[s][t-1] = '.'; for(int i = 0; i < ans_l.size(); i++){ for(int j = 0; j < ans_l[i].size(); j++){ ans[s+i][t+j] = ans_l[i][j]; } } s = l+1+ans_l.size(), t = r+1+ans_l[0].size(); ans[s][t-1] = '.'; for(int i = 0; i < ans_r.size(); i++){ for(int j = 0; j < ans_r[i].size(); j++){ ans[s+i][t+j] = ans_r[i][j]; } } memo[n] = ans; ok[n] = true; return memo[n]; } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; int n; cin >> n; auto ans = solve(n); cout << ans.size() << ' ' << ans[0].size() << endl; print_vector(ans, '\n'); }