#include <iostream>
#include<math.h>
using namespace std;
int main() {
// your code goes here
int n;
char c;
cin>>n>>c;
int flo=sqrt((n+1)/2);
for(int i=0;i<flo;i++){
for(int j=0;j<i;j++)
cout<<" ";
for(int k=0;k<2*(flo-i)-1;k++)
cout<<c;
cout<<endl;
}
for(int i=2;i<flo;i++){
for(int j=0;j<flo-i;j++)
cout<<" ";
for(int k=0;k<2*i-1;k++)
cout<<c;
cout<<endl;
}
cout<<n-2*flo*flo+1;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTxtYXRoLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCWludCBuOwogICAgY2hhciBjOwoJY2luPj5uPj5jOwoJaW50IGZsbz1zcXJ0KChuKzEpLzIpOwoJZm9yKGludCBpPTA7aTxmbG87aSsrKXsKCQlmb3IoaW50IGo9MDtqPGk7aisrKQoJCQljb3V0PDwiICI7CgkJCWZvcihpbnQgaz0wO2s8MiooZmxvLWkpLTE7aysrKQoJCQkJY291dDw8YzsKCQkJCQljb3V0PDxlbmRsOwoJfQoJZm9yKGludCBpPTI7aTxmbG87aSsrKXsKCQlmb3IoaW50IGo9MDtqPGZsby1pO2orKykKCQkJY291dDw8IiAiOwoJCQlmb3IoaW50IGs9MDtrPDIqaS0xO2srKykKCQkJCWNvdXQ8PGM7CgkJCQkJY291dDw8ZW5kbDsKCX0KCWNvdXQ8PG4tMipmbG8qZmxvKzE7CglyZXR1cm4gMDsKfQ==