#include <bits/stdc++.h> using namespace std; typedef long long ll; ll ev(ll w,ll h){ return w*(w-1)/2*h*(h-1)/2; } vector<pair<int,int>>strat1(ll k){ ll w=2025,h=2025; vector<pair<int,int>>res; while(h>=2){ while(ev(w,h)<=k){ k-=ev(w,h); res.push_back({w,h}); } h--; } h++; while(w>=2){ while(ev(w,h)<=k){ k-=ev(w,h); res.push_back({w,h}); } w--; } return res; } vector<vector<pair<int,int>>>strat2(ll k){ ll w=2025,h=2025; vector<pair<int,int>>cres; vector<pair<vector<pair<int,int>>,ll>>res; while(h>=2){ while(ev(w,h)<=k){ k-=ev(w,h); cres.push_back({w,h+1}); res.emplace_back(cres,k+ev(w,h)); cres.back().second--; } h--; } for(auto&[i,k]:res) { if(i.size()){ while(k<ev(i.back().first,i.back().second)){ i.back().first--; } k-=ev(i.back().first,i.back().second); } while (w >= 2) { while (ev(w, 2) <= k) { k -= ev(w, 2); i.push_back({w, 2}); } w--; } } vector<vector<pair<int,int>>>res2; for(auto i:res) res2.push_back(i.first); return res2; } bool check(vector<pair<int,int>>res){ int y=0,x=0; for(auto i:res){ if(x+i.first>2025){ x=0; y+=3; } if(y+i.second-1>=2025){ return false; } if(i.second!=2) y+=i.second+1; else{ x+=i.first+1; } } return true; } void out(vector<pair<int,int>>res) { vector grid(2025,vector(2025,false)); int y=0,x=0; for(auto i:res){ if(x+i.first>2025){ x=0; y+=3; } for(int i1=0;i1<i.first;i1++){ for(int i2=0;i2<i.second;i2++){ grid[y+i2][x+i1]=true; } } if(i.second!=2) y+=i.second+1; else{ x+=i.first+1; } } cout<<"2025 2025\n"; for(auto i:grid){ for(auto j:i){ cout<<(j?'#':'.'); } cout<<"\n"; } } void solve(){ ll k; cin>>k; vector<vector<pair<int,int>>>tries; tries.push_back(strat1(k)); for(auto i:strat2(k)) { tries.push_back(i); } /*for(auto i:tries){ cout<<"===========\n"; for(auto j:i){ cout<<j.first<<" "<<j.second<<"\n"; } }*/ for(auto i:tries){ if(check(i)){ out(i); return; } } abort(); //cout<<"NO\n"; } int main(){ ios_base::sync_with_stdio(0),cin.tie(0); int t=1;//cin>>t; while(t--) solve(); }