#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll k;
int n;
vector<int> v;
string ans[49], pa[7]={"", "....", "X...", "XX..", "XXX.", "XdXX", "XXXX"};
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> k;
while(k) {
v.push_back(k%6);
k/=6;
}
n=2*v.size()+1;
for(int i=0; i<n; ++i) {
ans[i]=string(n, i<n-1?'.':'r');
ans[i][n-1]=i<n-1?'d':'.';
}
auto p=[&](int i, int x, int y) {
ans[i][i+2]=ans[i+1][i+2]='d';
ans[i+2][i]=ans[i+2][i+1]='r';
for(int j1 : {0, 1})
for(int j2 : {0, 1})
ans[i+j1][i+j2]=pa[x][j1*2+j2];
if(y%3)
ans[i+2][i]='X';
if(y%3==2)
ans[i][i+2]='X';
if(y>=3)
ans[i+1][i+2]='X';
};
for(int i=0; i<v.size(); ++i)
p(2*i, i+1<v.size()?6:v[i], i+1<v.size()?v[i]:0);
cout << n << " " << n << "\n";
for(int i=0; i<n; ++i)
cout << ans[i] << "\n";
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIGxsIGxvbmcgbG9uZwoKbGwgazsKaW50IG47CnZlY3RvcjxpbnQ+IHY7CnN0cmluZyBhbnNbNDldLCBwYVs3XT17IiIsICIuLi4uIiwgIlguLi4iLCAiWFguLiIsICJYWFguIiwgIlhkWFgiLCAiWFhYWCJ9OwoKaW50IG1haW4oKSB7Cglpb3M6OnN5bmNfd2l0aF9zdGRpbygwKTsKCWNpbi50aWUoMCk7CgoJY2luID4+IGs7Cgl3aGlsZShrKSB7CgkJdi5wdXNoX2JhY2soayU2KTsKCQlrLz02OwoJfQoJbj0yKnYuc2l6ZSgpKzE7Cglmb3IoaW50IGk9MDsgaTxuOyArK2kpIHsKCQlhbnNbaV09c3RyaW5nKG4sIGk8bi0xPycuJzoncicpOwoJCWFuc1tpXVtuLTFdPWk8bi0xPydkJzonLic7Cgl9CglhdXR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