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

const ll LEN = 2025;

array<array<bool, LEN>, LEN> field;

int main() {

    ll k;
    cin >> k;

    ll t; 
    ll n;
    double v;
    vector<pair<ll, ll>> squares;
    while (k) {
        t = 0;
        for (ll m = 1LL << 10; m >= 2; m >>= 1) {
            v = ((t+m)*(t+m-1))/2;
            n = 0.5 + sqrt(0.25 + (float)(k / v) * 2.0);
            if (n < 2) continue;
            if (m+t <= 2025) t+=m;
        }
        v = ((t)*(t-1))/2;
        n = 0.5 + sqrt(0.25 + (float)(k / v) * 2.0);
        squares.push_back({t, n});

        k -= v * (n*(n-1))/2;

        // cout << (t*(t-1))/2 << endl;
        // cout << endl << "n and m ";
        // cout << t << " ";
        // cout << floor(0.5 + sqrt(pow(0.25, 2) + (k / v) * 2.0)) << endl;

    }
    ll x = 0;
    ll two = 0;

    for (auto [a, b]: squares) {
        if (a < b) swap(a, b);
        if (b == 2) {
            if (two + a > 2025) {
                two = 0;
                x += 3;
            }
            for (int y = two; y < two + a; y++) {
                for (int x1 = x; x1 < x + b; x1++) 
                    field[x1][y] = true;
            }
            two += a + 1;
        } else {
            for (int y = 0; y < a; y++) {
                for (int x1 = x; x1 < x + b; x1++) 
                    field[x1][y] = true;
            }
            x += b + 1;
            
        }
    }
    cout << LEN << " " << LEN << endl;
    for (int i = 0; i < LEN; i++) {
        for (int j = 0; j < LEN; j++) {
            cout << (field[i][j] == true ? '#' : '.');
        }
        cout << endl;
    }





    return 0;
}