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

#define rep(i, a, b) for (ll i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll calc(ll k) {
    return (2025LL * 2025LL * 2024LL * 2024LL) / 2 - (k * k * (k - 1) * (k - 1));
}

ll lowk(ll x) {
    ll lower = 2, higher = 2026;
    while (lower + 1 < higher) {
        ll mid = (lower + higher) / 2;
        if (calc(mid) < x) higher = mid;
        else lower = mid;
    }
    return lower;
}

int main() {
    cin.tie(0)->sync_with_stdio(0);
    cin.exceptions(cin.failbit);
    ll x;
    cin >> x;
    if (x == 0) {
        printf("1 1 \n.\n");
        return 0;
    }
    vector<pair<ll, pii>> w;
    rep(i, 1, 2026) rep(j, i, 2026) w.push_back({i * j * (i - 1) * (j - 1) / 4, {i, j}});
    sort(all(w), [](auto &x, auto &y) { return x.first < y.first; });
    ll l = 0;
    rep(i, 0, sz(w)) if (w[i].first <= x) l = i;
    auto [a, b] = w[l].second;
    printf("%d %d\n", 2025, 2025);
    vector<vector<char>> m(2025, vector<char>(2025, '.'));
    rep(i, 0, a) rep(j, 0, b) m[i][j] = '#';
    ll s = a + 1;
    ll t = 2025 - s;
    x -= w[l].first;
    w.clear();
    rep(i, 1, t) rep(j, i, 100) w.push_back({i * j * (i - 1) * (j - 1) / 4, {i, j}});
    sort(all(w), [](auto &x, auto &y) { return x.first < y.first; });
    ll q = 0;
    while (x > 0) {
        ll l = 0;
        rep(i, 0, sz(w)) if (w[i].first <= x) l = i;
        auto [a, b] = w[l].second;
        x -= w[l].first;
        rep(i, 0, a) rep(j, 0, b) m[i + s][j + q] = '#';
        q += b + 1;
    }
    rep(i, 0, 2025) {
        rep(j, 0, 2025) printf("%c", m[i][j]);
        printf("\n");
    }
/*
        ll e = 0;
        rep(l, 1, sz(v)) {
            ll k = v[l];
            rep(i, 0, k) rep(j, 0, k) m[i + s][j + e] = '#';
            e += k + 1;
        }


    ll ma = 0;
    rep(i, 0, sz(w) - 1) if (w[i + 1] <= 4000000000000LL) ma = max(ma, w[i + 1] - w[i]);
    printf("%lld\n", ma);
    w.clear();
    rep(i, 1, 24) rep(j, 1, 24) w.push_back(i * j * (i - 1) * (j - 1));
    sort(all(w));
    ma = 0;
    rep(i, 0, sz(w) - 1) if (w[i + 1] <= 32048) ma = max(ma, w[i + 1] - w[i]);
    printf("%lld\n", ma);

    ll x;
    cin >> x;
    vi v;
    while (x > 0) {
        ll k = lowk(x);
        x -= calc(k);
        printf("%lld %lld\n", k, x);
        v.push_back(k);
    }
    printf("%d %d\n", 2025, 2025);
    vector<vector<char>> m(2025, vector<char>(2025, '.'));
    if (!v.empty()) {
        ll k = v[0];
        rep(i, 0, k) rep(j, 0, k) m[i][j] = '#';
        ll s = k + 1;
        ll e = 0;
        rep(l, 1, sz(v)) {
            ll k = v[l];
            rep(i, 0, k) rep(j, 0, k) m[i + s][j + e] = '#';
            e += k + 1;
        }
    }
    rep(i, 0, 2025) {
        //rep(j, 0, 2025) printf("%c", m[i][j]);
        //printf("\n");
    }*/
}