#include <iostream>
#include <cstring>
#include <cstdlib>
#include <string>
using namespace std;
void TrimRight( char *s )
{
int _strlen = 0;
int i=0;
for ( ; s[i]!='\0'; ++i )
if (s[i] != ' ') _strlen = i;
s = (char*)realloc(s, (_strlen+1) * sizeof(char));
s[_strlen+1]='\0';
}
int main()
{
char *str = new char[255];
cin.getline(str, 255);
cout<<str<<"\\end "<<endl;
TrimRight(str);
cout<<str<<"\\end "<<endl;
free(str);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDxzdHJpbmc+CiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCiAKIHZvaWQgVHJpbVJpZ2h0KCBjaGFyICpzICkKIAogewogICAgaW50IF9zdHJsZW4gPSAwOyAgICAgICAgIAogICAgaW50IGk9MDsKICAgICAgICAKICAgIGZvciAoIDsgc1tpXSE9J1wwJzsgKytpICkgIAoKICAgICAgaWYgKHNbaV0gIT0gJyAnKSBfc3RybGVuID0gaTsgICAgICAgICAgICAgCiAgICAKICAgIHMgPSAoY2hhciopcmVhbGxvYyhzLCAoX3N0cmxlbisxKSAqIHNpemVvZihjaGFyKSk7ICAgIAogICAgc1tfc3RybGVuKzFdPSdcMCc7ICAgCiB9CiAKIAppbnQgbWFpbigpCiAKewogICBjaGFyICpzdHIgPSBuZXcgY2hhclsyNTVdOyAgCiAgIGNpbi5nZXRsaW5lKHN0ciwgMjU1KTsKICAgY291dDw8c3RyPDwiXFxlbmQgIjw8ZW5kbDsgICAKICAgVHJpbVJpZ2h0KHN0cik7CiAgIGNvdXQ8PHN0cjw8IlxcZW5kICI8PGVuZGw7CiAgIGZyZWUoc3RyKTsKfQ==
SGVsbG8gV29ybGQgISAgICAgICAgIC8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2IC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg