#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll MAX = (ll)4e13;
const int N = 2025;
char soln[N][N];

ll k;
ll aa, bb;
ll sum = 0;

void solve(int i1, int j1, int i2, int j2){
    if(i1 > i2 || j1 > j2) return;
    if(k ==0 ) return;
    int p = 0;
    int q = 0;
    ll big = 0;
    
    for(int x = i2; x >= i1; x -- ){
        for(int y = j2; y >= j1; y -- ){
            ll ni = x - i1 + 1;
            ll nj = y - j1 + 1;
            ll f = (ni * 1ll * (ni - 1) / 2ll) * 1ll * (nj * 1ll * (nj - 1) / 2ll);
            if(f <= k){
                if(f > big){
                    big = f;
                    p = x;
                    q = y;
                }
            }            
        }
    }
    if(big == 0) return;
    k -= big;
    int na = p - i1 + 1;
    int ma = q - j1 + 1;
    ll take = (na * 1ll * (na - 1) / 2ll) * 1ll * (ma * 1ll * (ma - 1) / 2ll);
    sum += take;
    for(int x = i1; x <= p; x ++ ){
        for(int y = j1; y <= q; y ++ ){
            soln[x][y] = '#';
        }
    }
    int st = j1;
    for(int d = ma; d >= 1; d -- ){
        for(int e = p + 1; e <= i2; e ++ ){
            if(st + d > q) break;
            int l1 = e - p;
            ll qu = d * 1ll * (d - 1) / 2ll;
            ll qv = l1 * 1ll * na;
            qu *= qv;
            if(qu == 0) continue;
            if(qu <= k){
                for(int x = 0; x < d; x ++ ){
                    for(int y = p + 1; y <= e; y ++ ){
                        soln[y][st + x] = '#';
                    }
                }
                k -= qu;
                st += d + 1;
            }
        }
    }
    solve(i1, q + 2, i2, j2);
}

ll g(ll x){
    return x * 1ll * (x - 1) / 2ll;
}

int main(){
    cin >> k;
    ll kk = k;
    for(int i = 0; i < N; i ++ ){
        for(int j = 0 ; j < N; j ++ ){
            soln[i][j] = '.';
        }
    }
    solve(0, 0, N - 1, N - 1);
    cout << N << " " << N << "\n";
    for(int i = 0 ; i < N; i ++ ){
        for(int j = 0 ; j < N; j ++ ){
            cout << soln[i][j];
        }
        cout << "\n";
    }
    return 0;
}