#include <bits/stdc++.h>

using namespace std;

using ll = long long;

inline ll comb2(ll n) {
    return n * (n - 1) / 2;
} 

constexpr int H = 2025;
constexpr int W = 2025;

char grid[2025][2025];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    for(int y = 0; y < H; ++ y) {
        for(int x = 0; x < W; ++ x) {
            grid[y][x] = '.';
        }
    }

    ll k;
    cin >> k;

    int rows = 1;
    for(int i = 0; i < W; ++ i) {
        grid[0][i] = '#';
    }

    for(ll currw = W; currw >= 2 && k > 0;) {
        ll cv = comb2(currw) * rows;
        if(cv <= k) {
            k -= cv;
            for(int i = 0; i < currw; ++ i) {
                grid[rows][i] = '#';
            }
            ++ rows;
        } else {
            -- currw;
        }
    }

    //cerr << k << "\n";

    for(int bx = 0; k > 0; bx += 3) {
        for(int by = H - 1, yc = 0; yc < 4 && k > 0; ++ yc, by -= 3 ) {
            -- k;
            for(int dy = 0; dy < 2; ++ dy) {
                for(int dx = 0; dx < 2; ++ dx) {
                    grid[by - dy][bx + dx] = '#';
                }
            }
        }
    }

    //cerr << rows << " " << k << "\n";
    
    cout << H << " " << W << '\n';
    for(int y = 0; y < H; ++ y) {
        for(int x = 0; x < W; ++ x) {
            cout << grid[y][x];
        }
        cout << '\n';
    }//*/
}