using namespace std;
#include <bits/stdc++.h>
typedef long long ll;

#define int long long

#define rep(i,a,b) for(int i = a; i < b; i++)


const int n = 2025;
const int second = 20;

vector<vector<int>> ans(n, vector<int>(n, 0));

ll sz(ll x, ll y) {
    return (x*(x-1)/2) * (y*(y-1))/2;
}

signed main() {

    ll k; cin >> k;

    ll x = 2025;
    ll offset = 0;

    

    while (k) {
        ll y = 2;
        if (sz(x, 2) > k) break;

        while (sz(x, y+1) <= k) y++;

        if (y < 10) break;

        rep(i,0,x) rep(j,offset,offset+y) ans[i][j] = 1;
        offset += (y+1);
        cout << x << " " << y << endl;

        k -= sz(x, y);
    }

    ll xoffset = 0;
    ll y = 20;

    while (y) while (k) {
        ll x = 2;
        cout << k << endl;
        assert(offset < 2024);
        while (xoffset + x < 2025 && sz(x+1, y) <= k) x++;
        if (x < 100) y--;
        assert(x <= 2025);

        rep(i,xoffset,x+xoffset) rep(j,offset,offset+y) ans[i][j] = 1;
        xoffset += (x+1);
        if (xoffset > 2015) {
            offset += (y+1);
            xoffset = 0;
        }
        cout << x << " " << y << endl;
        k -= sz(x, y);
    }



    assert(k == 0);
    cout << n << " " << n << endl;
    rep(i,0,n) {
       rep(j,0,n) cout << ((ans[i][j]) ? "#" : ".");
        cout << endl;
    }
}