#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3,unroll-loops")

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

using ll = long long;
// #define int ll
using pii = pair<int, int>;

mt19937 rnd(42432);
const ll M = 4e12 + 1;
char a[2028][2028];
const int N = 2025;
int CNT= 0;
int max_x = 0;
int max_y = 0;
bool try_place(int n, int m) {
    // cerr << max_x << " " << max_y << endl;
    for (int i = max_x; i + n <= N; i++) {
        for (int j = 0; j + m <= N; j++) {
            bool g = 1;
            for (int x = 0; x < n && g; x++) {
                for (int y = 0; y < m && g; y++) {
                    // CNT++;
                    if (a[i + x][j + y] != '?')
                        g = 0;
                }
            }

            if (g == 0)
                continue;
            // cerr << i << " " << j << endl;
            for (int x = 0; x <= n; x++) {
                for (int y = 0; y <= m; y++) {
                    if (x == n || y == m)
                        a[i + x][j + y] = '.';
                    else
                        a[i + x][j + y] = '#';
                    // CNT++;
                }
            }
            max_x = max(max_x, n + i);
            max_y = max(max_y, m + j);
            return true;
        }
    }

    for (int i = 0; i + n <= N; i++) {
        for (int j = max_y; j + m <= N; j++) {
            bool g = 1;
            for (int x = 0; x < n && g; x++) {
                for (int y = 0; y < m && g; y++) {
                    // CNT++;
                    if (a[i + x][j + y] != '?')
                        g = 0;
                }
            }

            if (g == 0)
                continue;
            for (int x = 0; x <= n; x++) {
                for (int y = 0; y <= m; y++) {
                    if (x == n || y == m)
                        a[i + x][j + y] = '.';
                    else
                        a[i + x][j + y] = '#';
                    // CNT++;
                }
            }
            max_x = max(max_x, n + i);
            max_y = max(max_y, m + j);
            return true;
        }
    }

    return false;
}

pair<ll, pii> all[N * N];

void solve() {
 max_x = 0;
 max_y = 0;
    ll k = M - 1 - rnd() % 100;
    // cout << k << endl;
    cin >> k;
    int n = 2025;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)
            a[i][j] = '?';
    }

    
    int t = 0;
    for (int i = 1; i <= n; i++) {
        for (int j = i; j <= n; j++) {
            ll cur = 1ll * i * j * (i - 1) * (j - 1) / 4ll;
            if (cur <= k)
                all[t++] = {cur, {i, j}};
        }
    }
    // cerr << all.size() << endl;
    int cnt = 0;
    sort(all, all + t, greater());
    for (int i = 0; i < t; i++) {
        auto [v, px] = all[i];
        if (k == 0)
            break;
        while (k >= v) {
            //  && !try_place(px.second, px.first)
            if (!try_place(px.first, px.second) && !try_place(px.second, px.first))
                break;

            k -= v;
            cnt++;
        }
    }
    // if (CNT > 1e8 || k > 6)
        cout << cnt << " " << k << " " << CNT << endl;
    // else
        // cout << "Pass" << endl;
    // CNT = 0;
    cout << 2025 << " " << 2025 << "\n";
    for (int i = 0; i < 2025; i++) {
        for (int j = 0; j < 2025; j++) {
            if (a[i][j] == '?')
                a[i][j] = '.';
            cout << a[i][j];
        }
        cout << "\n";
    }

    // for (int i = 0; i < 10; i++) {
    //     for (int j = 0; j < 10; j++) {
    //         if (a[i][j] == '?')
    //             a[i][j] = '.';
    //         cout << a[i][j];
    //     }
    //     cout << "\n";
    // }
}

int32_t main() {
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);

    int tt = 1;
    // cin >> tt;
    for (int t = 0; t < tt; t++) {
        solve();
    }
    return 0;
}