#include <bits/stdc++.h>

using namespace std;
using ll = int64_t;

int u = 0;
int r = 0;
vector<string> pl;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	ll k;
	cin >> k;

	if(k == 0) {
		cout << "1 1\n";
		cout << ".\n";
		return 0;
	}
	pl.resize(2025, string(2025, '.'));

	while(k > 0) {
		//cerr << "---" << '\n';
		//cerr << k << '\n';
		//cerr << r << '\n';
		//cerr << u << '\n';
		//cerr << "---" << '\n';
		ll w = 2025 - r;
		ll h = 2025 - u;
		if(w < h) {
			ll a = w;
			ll b = 2;
			while(a*(a-1)*b*(b-1)/4 > k) {
				--a;
			}
			while(a*(a-1)*b*(b+1)/4 <= k) {
				++b;
			}
			k -= a*(a-1)*b*(b-1)/4;
			for(int y = u; y < u+b; ++y) {
				for(int x = r; x < r+a; ++x) {
					pl[y][x] = '#';
				}
			}
			u += b+1;
		} else {
			ll a = h;
			ll b = 2;
			while(a*(a-1)*b*(b-1)/4 > k) {
				--a;
			}
			while(a*(a-1)*b*(b+1)/4 <= k) {
				++b;
			}
			k -= a*(a-1)*b*(b-1)/4;
			for(int y = u; y < u+a; ++y) {
				for(int x = r; x < r+b; ++x) {
					pl[y][x] = '#';
				}
			}
			r += b+1;
		}
	}

	cout << pl.size() << ' ' << pl[0].size() << '\n';
	for(int i = 0; i < pl.size(); ++i) {
		cout << pl[i] << '\n';
	}
	

	return 0;
}