#include <iostream>
#include <algorithm>
#include <string>
#include <cctype>
using namespace std;
void rect(int w, int h)
{
cout << string(w, '*') << endl;
for(int i = 0; i < h - 2; ++i)
cout << '*' << string(w - 2, ' ') << '*' << endl;
cout << string(w, '*') << endl;
}
int main()
{
rect(8, 5);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8Y2N0eXBlPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnZvaWQgcmVjdChpbnQgdywgaW50IGgpCnsKCWNvdXQgPDwgc3RyaW5nKHcsICcqJykgPDwgZW5kbDsKCWZvcihpbnQgaSA9IDA7IGkgPCBoIC0gMjsgKytpKQoJCWNvdXQgPDwgJyonIDw8IHN0cmluZyh3IC0gMiwgJyAnKSA8PCAnKicgPDwgZW5kbDsKCWNvdXQgPDwgc3RyaW5nKHcsICcqJykgPDwgZW5kbDsKfQppbnQgbWFpbigpCnsKCXJlY3QoOCwgNSk7Cn0=