#include <iostream>
using namespace std;
int main() {
std::string routingLine = "ABC DEB MEM DEB LOL HEH PUC";
std::string starAtsRouteDescription = "DEB";
size_t found = routingLine.rfind(starAtsRouteDescription);
if (found != string::npos) {
routingLine.replace(found - 1, starAtsRouteDescription.length() + 1, "");
}
cout << routingLine;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglzdGQ6OnN0cmluZyByb3V0aW5nTGluZSA9ICJBQkMgREVCIE1FTSBERUIgTE9MIEhFSCBQVUMiOwoJc3RkOjpzdHJpbmcgc3RhckF0c1JvdXRlRGVzY3JpcHRpb24gPSAiREVCIjsKCQogICAgc2l6ZV90IGZvdW5kID0gcm91dGluZ0xpbmUucmZpbmQoc3RhckF0c1JvdXRlRGVzY3JpcHRpb24pOwogICAgaWYgKGZvdW5kICE9IHN0cmluZzo6bnBvcykgewogICAgICAgIHJvdXRpbmdMaW5lLnJlcGxhY2UoZm91bmQgLSAxLCBzdGFyQXRzUm91dGVEZXNjcmlwdGlvbi5sZW5ndGgoKSArIDEsICIiKTsKICAgIH0KICAgIAogICAgY291dCA8PCByb3V0aW5nTGluZTsKICAgICAgICAKCXJldHVybiAwOwp9