#include "bits/stdc++.h"
using namespace std;

#define int long long
#define ld long double
#define ll long long
#define st first
#define nd second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(x) begin(x),end(x)
#define FOR(i,l,r) for(int i = (l); i <= (r); i++)
#define ROF(i,r,l) for (int i = (r); i >= (l); i--)

auto& operator<<(auto&o, pair<auto,auto>p) {
	return o << "("  << p.st << ", " << p.nd << ")";
}
auto operator<<(auto&o, auto x)->decltype(end(x), o) {
	o << "{"; int i =0; for (auto e : x) o << ","+!i++ << e; 
	return o << "}";
}
#ifdef LOCAL
#define debug(x...) cerr << "[" #x "]: ", [](auto...$) { \
	((cerr << $ << "; "), ...) << endl; }(x)
#else
#define debug(...) {}
#endif

#define rep(i, a, b) for (int i = (a); i < (b); i++)
using pii = pair<int, int>;
using vi = vector<int>;

const int inf = 1e9 + 7;


char g[2030][2030];
int ile[2030][2030];


signed main() {
	cin.tie(0)->sync_with_stdio(0);
	srand(time(NULL));
	int k,n=2025;
	cin>>k;
	FOR(i,2,n)
	{
		FOR(j,2,n)
		{
			ile[i][j]=ile[i-1][j]+ile[i][j-1]-ile[i-1][j-1]+(i-1)*(j-1);
		}
	}
	FOR(ff,1,n)
	{
		bool nie=0;
		int x=ff,y=1;
		FOR(i,1,n) FOR(j,1,n) g[i][j]='.';
		while(k>0&&x<=n&&y<=n)
		{
			bool xd=0;
			if(ile[n-x+1][n-y+1]==k)
			{
				FOR(i,x,n) FOR(j,y,n) g[i][j]='#';
				k=0;
				break;
			}
			if(x>y)
			{
				if(k<ile[n-x+1][2])
				{
					int l=x-1;
					FOR(i,x,n)
					{
						if(ile[i-l][2]>k)
						{
							k-=ile[i-l-1][2];
							l=i;
						}
						else
						{
							g[i][y]='#';
							g[i][y+1]='#';
						}
					}
					if(l!=n) k-=ile[2][n-l];
					y+=3;
					xd=1;
				}
				else
				{
					FOR(l,1,n-y+1)
					{
						if(ile[n-x+1][l]>k)
						{
							k-=ile[n-x+1][l-1];
							y+=l;
							xd=1;
							break;
						}
						FOR(i,x,n) g[i][y+l-1]='#';
					}
				}
			}
			else
			{
				if(k<ile[2][n-y+1]) 
				{
					int l=y-1;
					FOR(j,y,n)
					{
						if(ile[2][j-l]>k)
						{
							k-=ile[2][j-l-1];
							l=j;
						}
						else
						{
							g[x][j]='#';
							g[x+1][j]='#';
						}
					}
					if(l!=n) k-=ile[2][n-l];
					x+=3;
					xd=1;
				}
				else
				{
					FOR(l,1,n-x+1)
					{
						if(ile[l][n-y+1]>k)
						{
							k-=ile[l-1][n-y+1];
							x+=l;
							xd=1;
							break;
						}
						FOR(j,y,n) g[x+l-1][j]='#';
					}
				}
			}
			if(!xd)
			{
				nie=1;
				break;
			}
		}
		if(!nie&&k==0) break;
	}
	/*debug(k);
	int ans=0;
	FOR(x1,1,n)
	{
		FOR(y1,1,n)
		{
			FOR(x2,x1+1,n)
			{
				FOR(y2,y1+1,n)
				{
					bool is=1;
					FOR(i,x1,x2) is&=(g[i][y1]=='#');
					FOR(i,x1,x2) is&=(g[i][y2]=='#');
					FOR(i,y1,y2) is&=(g[x1][i]=='#');
					FOR(i,y1,y2) is&=(g[x2][i]=='#');
					ans+=is;
				}
			}
		}
	}
	debug(ans,k);*/
	cout<<n<<" "<<n<<endl;
	FOR(i,1,n) 
	{
		FOR(j,1,n) cout<<g[i][j];
		cout<<endl; 
	}

	return 0;
}