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

typedef long long ll;

#ifdef DEBUG
    #define var(x) cerr << #x << ": " << x << '\n';
    #define range(a, b) cerr << #a <<", " << #b << ": "; for (auto _it = a; _it != b; ++_it) cerr << *_it << ' '; cerr <<'\n';
#else
    #define cerr if (false) cerr
    #define var(x)
    #define range(a, b)
#endif

#define pii pair<int, int>
#define F first
#define S second
#define T(x, i) get<i>(x)
#define all(v) v.begin(), v.end()
#define forn(i, n) for (int i = 0; i < n; i++)

#define int ll

#ifdef DEBUG
    const int N = 20;
#else
    const int N = 2000;
#endif


int k;

void solver(ll k) {
    vector<string> ans(N + 25, string(N + 25, '.'));
    // for (int i = 0; i < N; i++) {
    //     ans[i].resize(N + 25, '.');
    //     for (auto &c : ans)
    //         c = '.';
    // }

    bool val[N][N];
    for (int i = 0; i < N; i++)
        for (int j = 0; j < N; j++) {
            val[i][j] = (i == 0) || (j == 0);
            if (val[i][j])
                ans[i][j] = '#';
        }

    std::priority_queue<pair<int,pii>, std::vector<pair<int,pii>>, std::less<pair<int,pii>>> can;
    can.push({1 * 1, {1, 1}});


    auto adder = [&](int a, int b) {
        if (a >= N || b >= N)
            return;
        if (val[a][b])
            return;
        if (ans[a - 1][b] == '#' && ans[a][b - 1] == '#') {
            val[a][b] = true;
            // cerr << "\t\t val " << a << ' ' << b << endl;
            can.push({a * b, {a, b}});
        }
    };

    ll need = k;
    while (true) {
        if (can.empty())
            break;

        auto [v, ab] = can.top();
        can.pop();
        // var(v << ' ' << can.size());
        auto [a, b] = ab;
        // v *= -1;
        if (need < v) {
            continue;
        }


        // cerr << "\t used " << a << ' ' << b << endl;
        need -= v;
        val[a][b] = true;
        ans[a][b] = '#';

        // var("added " << a << ' ' << b);
        // if (a * b >= 10)
        //     return;

        adder(a + 1, b);
        adder(a, b + 1);
    }

    auto put = [&](int a, int b) {
        ans[ans.size() - 1 - a][ans.size() - 1 - b] = '#';
    };

    for (int i = 0; i < 12; i += 3) {
        for (int j = 0; j < ans.size() - 10; j += 3) {
            if (need) {
                need -= 1;
                put(i + 0, j + 0);
                put(i + 0, j + 1);
                put(i + 1, j + 0);
                put(i + 1, j + 1);
            }
        }
    }

    cout << ans.size() << ' ' << ans[0].size() << endl;
    for (int i = 0; i < ans.size(); i++)
        cout << ans[i] << '\n';

    cerr << k << ' ' << "left with " << need << endl;
    cerr << clock() * 1.0 / CLOCKS_PER_SEC << '\n';
}

signed main() {
    #ifdef DEBUG
        freopen("input.in", "r", stdin);
        freopen("output.out", "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    while (cin >> k) solver(k);


    // ll MX = 4ll * 1000 * 1000 * 1000 * 1000ll;
    // int C = 100;
    // int ii = 1;
    // int st = 0 * C + 1;
    // for (ll i = MX - C; i <= MX; i++)  {
    //     solver(i);
    //     // if (i % (C / 20) == 0) {
    //     //     cerr << i << '\n';
    //     // }
    // }



}