#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;

int main2(ll x);

int main() {
    /*
    while (1) {
        ll z = rand();
        ll y = rand();
        ll x = (z * y) % 4000000000000LL;
        fprintf(stderr, "%lld\n", x);
        main2(x);
    }
    */
    
    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;
    }
    main2(x);
}

int main2(ll x) {
    vector<pair<ll, pii>> w;
    rep(i, 1, 2026) rep(j, i, 2026) w.push_back({i * j * (i - 1LL) * (j - 1LL) / 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;
    fprintf(stderr, "--%lld\n", w[l].first);
    fprintf(stderr, "--%lld %lld\n", w[l].second.first, w[l].second.second);
    fprintf(stderr, "--%lld\n", w[l + 1].first);
    fprintf(stderr, "--%lld %lld\n", w[l + 1].second.first, w[l + 1].second.second);
    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, 200) w.push_back({i * j * (i - 1LL) * (j - 1LL) / 4, {i, j}});
    rep(i, 3 * t/4, t) rep(j, max(i, 200LL), 1500) 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;
    fprintf(stderr, "%lld %lld\n", a, b);
    fprintf(stderr, "%lld\n", x);
    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;
        fprintf(stderr, "%lld %lld %lld %lld\n", a, b, s, q);
        fprintf(stderr, "%lld\n", x);
    }
    rep(i, 0, 2025) {
        rep(j, 0, 2025) printf("%c", m[i][j]);
        printf("\n");
    }
    return 0;
}