#include<bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define ll long long
#define iter set< pair<char,pair<int,int>> >::iterator
#define all(a) a.begin(),a.end()
#define endl '\n'
#define int long long

using namespace std;

const int N = 2025 + 3;
char ans[N][N];
int H=2025,W=2025;

int C_2(int n)
{
    return n*(n+1)/2;
}

int get(int n,int m)
{
    if (n==0 || m==0)return 0;
    int ans = C_2(n-1)*C_2(m-1);
    return ans;
}

int k;

int sq(int i,int j)
{
    return (H-i+1)*(W-j+1);
}

void rec(int st_i,int st_j)
{
   // cout<<st_i<<' '<<st_j<<' '<<k<<endl;
    int cur_m=W;
    int best_next_i=-1,best_next_j=-1;
    for (int i=st_i;i<=H;++i){
        int j = cur_m;
      //  cout<<st_i<<' '<<st_j<<' '<<i<<' '<<j<<' '<<get(i-st_i+1,j-st_j+1)<<' '<<get(i-st_i,j-st_j+1)<<endl;
        while(get(i-st_i+1,j-st_j+1)-get(i-st_i,j-st_j+1)>k && j>=st_j){
            --j;
        }
        for (int k=st_j;k<=j;++k){
            ans[i][k]='#';
        }
        if (best_next_i==-1 || sq(i+1,j+2)>sq(best_next_i,best_next_j)){
            if (i+1<=H && j+2<=W){
                best_next_i=i+1;
                best_next_j=j+2;
            }
        }
        k-=get(i-st_i+1,j-st_j+1)-get(i-st_i,j-st_j+1);
        cur_m=j;
    }
    if (k==0){
        return;
    } else {
        rec(best_next_i,best_next_j);
    }
}

main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    for (int i=0;i<=H;++i){
        for (int j=0;j<=W;++j){
            ans[i][j]='.';
        }
    }
    cin>>k;
    rec(1,1);
    cout<<H<<' '<<W<<endl;
    for (int i=1;i<=H;++i){
        for (int j=1;j<=W;++j){
            cout<<ans[i][j];
        }
        cout<<endl;
    }
}