#include <iostream>
using namespace std;
int main() {
unsigned int rozmiar = 1000;
unsigned short n, k = 0;
char tekst[rozmiar];
cin.clear();
cin >> n;
n=n+1;
while(n--)
{
cin.getline(tekst, rozmiar);
cout << '*' << tekst << '*' << endl;
for(int i=0; tekst[i] != (char)0; i++)
{
k++;
}
cout << '>';
for(int i=0; i<k/2; i++)
{
cout << tekst[i];
}
k = 0;
cout << '<' << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7Cgp1bnNpZ25lZCBpbnQgcm96bWlhciA9IDEwMDA7CnVuc2lnbmVkIHNob3J0IG4sIGsgPSAwOwpjaGFyIHRla3N0W3Jvem1pYXJdOwpjaW4uY2xlYXIoKTsKCmNpbiA+PiBuOwpuPW4rMTsKd2hpbGUobi0tKQp7CgljaW4uZ2V0bGluZSh0ZWtzdCwgcm96bWlhcik7CiAgICBjb3V0IDw8ICcqJyA8PCB0ZWtzdCA8PCAnKicgPDwgZW5kbDsKCWZvcihpbnQgaT0wOyB0ZWtzdFtpXSAhPSAoY2hhcikwOyBpKyspCgl7CgkJaysrOwoJfQoJY291dCA8PCAnPic7Cglmb3IoaW50IGk9MDsgaTxrLzI7IGkrKykKCXsKCQljb3V0IDw8IHRla3N0W2ldOwoJfQoJayA9IDA7Cgljb3V0IDw8ICc8JyA8PCBlbmRsOwp9CnJldHVybiAwOwp9