#include <bits/stdc++.h> using namespace std; #define int long long #define F first #define S second mt19937 rng(time(nullptr)); int rnd(int B){ return (unsigned long long)rng()%B; } signed main() { ios::sync_with_stdio(0); cin.tie(0); int k; cin>>k; if(k==0){ cout<<"1 1"<<endl; cout<<"."<<endl; return 0; } vector<int>a; vector<int>b; int cnt = 0; for(int j = 1010;j>0;j--){ for(int i = j;i>max(0LL,j-10);i--){ while(j*j*i*i<=k){ k-=j*j*i*i; cnt++; a.push_back(j); b.push_back(i); } } } int Lx = 0; int Ly = 0; for(auto u : a)Lx+= 2*u+2; for(auto u : b)Ly+= 2*u+2; Lx-=2; Ly-=2; vector<vector<int>>ans(Lx,vector<int>(Ly,1)); int lx = -1; int rx = Lx; int ly = -1; int ry = Ly; for(int i = 0;i<(int)a.size();i++){ lx+=a[i]+1; rx-=a[i]+1; ly+=b[i]+1; ry-=b[i]+1; for(int x = lx;x<=rx;x++){ ans[x][ly] = 0; ans[x][ry] = 0; } for(int y = ly;y<=ry;y++){ ans[lx][y] = 0; ans[rx][y] = 0; } } assert(Lx<=2025 && Ly<=2025); cout<<Lx<<" "<<Ly<<endl; for(int i = 0;i<Lx;i++){ for(int j = 0;j<Ly;j++){ if(ans[i][j])cout<<'#'; else cout<<'.'; } cout<<endl; } }