#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = n; i > 0; i--) {
for (int first = n; i % n == 0 && first > 0;) { //facem primul rand
cout << "*";
first--;
if (first == 0) {
cout << "\n";
}
}
if (i > n - 2) {
} else {
for (int copy = n; copy > 0;) {
if (copy == n || copy == 1) {
cout << "*";
} else {
cout << "$";
}
copy--;
}
cout << "\n";
}
for (int last = 1; last == i;) {//ultimul
for (int copy = n; copy > 0;){
cout << "*";
copy--;
}
i = 0;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBpbnQgbjsKICAgIGNpbiA+PiBuOwogICAgZm9yIChpbnQgaSA9IG47IGkgPiAwOyBpLS0pIHsKICAgIAlmb3IgKGludCBmaXJzdCA9IG47IGkgJSBuID09IDAgJiYgZmlyc3QgPiAwOykgeyAvL2ZhY2VtIHByaW11bCByYW5kCiAgICAJCQljb3V0IDw8ICIqIjsKICAgIAkJCWZpcnN0LS07CiAgICAJCQlpZiAoZmlyc3QgPT0gMCkgewogICAgCQkJCWNvdXQgPDwgIlxuIjsKICAgIAkJCX0KICAgIAkJfQogICAgCQlpZiAoaSA+IG4gLSAyKSB7CiAgICAJCQkKICAgIAkJfSBlbHNlIHsKICAgIAkJZm9yIChpbnQgY29weSA9IG47IGNvcHkgPiAwOykgewogICAgCQkJICBpZiAoY29weSA9PSBuIHx8IGNvcHkgPT0gMSkgewogICAgCQkJICAJY291dCA8PCAiKiI7CiAgICAJCQkgIH0gZWxzZSB7CiAgICAJCQkgIAljb3V0IDw8ICIkIjsKICAgIAkJCSAgfQogICAgCQkJICBjb3B5LS07CiAgICAJCX0KICAgIAkJY291dCA8PCAiXG4iOwogICAgCQl9CiAgICAJZm9yIChpbnQgbGFzdCA9IDE7IGxhc3QgPT0gaTspIHsvL3VsdGltdWwKICAgIAkJZm9yIChpbnQgY29weSA9IG47IGNvcHkgPiAwOyl7CiAgICAJCQljb3V0IDw8ICIqIjsKICAgIAkJCWNvcHktLTsKICAgIAkJfQogICAgCQlpID0gMDsKICAgIAl9CiAgICB9CiAgICByZXR1cm4gMDsKfQ==