#include <iostream>
using namespace std;
int main() {
char S;
cin >> S;
int w, h, t;
cin >> w >> h >> t;
char *s1 = new char[w];
for (int i = 0; i < w; i++) s1[i] = S;
int times;
times = (t * h) - (t - 1);
int num = 0;
bool flag = true;
char *tmp;
for (int i = 1; i <=times; i++) {
if(num < 0) num = 0;
tmp = new char [num];
for (int i = 0; i < num; i++) tmp[i] = ' ';
cout << tmp;
if (i % 2) cout << s1;
else {
for (int q = 0; q < w / 2 + w % 2; q++) {
cout << S;
if (q != w / 2 + w % 2 - 1) cout << " ";
}
}
if (!flag) num--;
else num++;
if (num == h / 2) flag = false;
if (num == 0) flag = true;
if (num == h / 2 && h % 2 == 0) num--;
if (i != times) cout << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgljaGFyIFM7CiAgICBjaW4gPj4gUzsKICAgIGludCB3LCBoLCB0OyAKICAgIGNpbiA+PiB3ID4+IGggPj4gdDsKICAgIGNoYXIgKnMxID0gbmV3IGNoYXJbd107CiAgICBmb3IgKGludCBpID0gMDsgaSA8IHc7IGkrKykgczFbaV0gPSBTOwogICAgaW50IHRpbWVzOyAKICAgIHRpbWVzID0gKHQgKiBoKSAtICh0IC0gMSk7CiAgICBpbnQgbnVtID0gMDsgCiAgICBib29sIGZsYWcgPSB0cnVlOwogICAgY2hhciAqdG1wOwogICAgZm9yIChpbnQgaSA9IDE7IGkgPD10aW1lczsgaSsrKSB7CiAgICAgICAgaWYobnVtIDwgMCkgbnVtID0gMDsKICAgICAgICB0bXAgPSBuZXcgY2hhciBbbnVtXTsKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bTsgaSsrKSB0bXBbaV0gPSAnICc7CiAgICAgICAgY291dCA8PCB0bXA7CiAgICAgICAgaWYgKGkgJSAyKSBjb3V0IDw8IHMxOwogICAgICAgIGVsc2UgewogICAgICAgICAgICBmb3IgKGludCBxID0gMDsgcSA8IHcgLyAyICsgdyAlIDI7IHErKykgewogICAgICAgICAgICAgICAgY291dCA8PCBTOwogICAgICAgICAgICAgICAgaWYgKHEgIT0gdyAvIDIgKyB3ICUgMiAtIDEpIGNvdXQgPDwgIiAiOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmICghZmxhZykgbnVtLS07CiAgICAgICAgZWxzZSBudW0rKzsKICAgICAgICBpZiAobnVtID09IGggLyAyKSBmbGFnID0gZmFsc2U7CiAgICAgICAgaWYgKG51bSA9PSAwKSBmbGFnID0gdHJ1ZTsKICAgICAgICBpZiAobnVtID09IGggLyAyICYmIGggJSAyID09IDApIG51bS0tOwogICAgICAgIGlmIChpICE9IHRpbWVzKSBjb3V0IDw8IGVuZGw7CiAgICB9CiAgICByZXR1cm4gMDsKfQ==