#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+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCWludCBuOwogICAgY2hhciBjOwoJY2luPj5uPj5jOwoJaW50IGZsbz1zcXJ0KChuKzEpLzIpOwoJZm9yKGludCBpPTA7aTxmbG87aSsrKXsKCQlmb3IoaW50IGo9MDtqPGk7aisrKQoJCQljb3V0PDwiICI7CgkJCWZvcihpbnQgaz0wO2s8MiooZmxvLWkpLTE7aysrKQoJCQkJY291dDw8YzsKCQkJCQljb3V0PDxlbmRsOwoJfQoJZm9yKGludCBpPTI7aTw9ZmxvO2krKyl7CgkJZm9yKGludCBqPTA7ajxmbG8taTtqKyspCgkJCWNvdXQ8PCIgIjsKCQkJZm9yKGludCBrPTA7azwyKmktMTtrKyspCgkJCQljb3V0PDxjOwoJCQkJCWNvdXQ8PGVuZGw7Cgl9Cgljb3V0PDxuLTIqZmxvKmZsbysxOwoJcmV0dXJuIDA7Cn0=