#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <list>
using namespace std;
class key
{
public:
int size;
string pat;
key( string set_key ) {
pat = set_key;
size = pat.size();
}
};
int main()
{
key hl("###");
string str = "###abc#def";
string::iterator itr = str.begin();
int count = 0;
int i = 0;
while( itr != str.end() ) {
if ( hl.pat[count] == *itr ) ++count;
++itr;
}
string tmp = "<h1>";
itr = str.begin() + count;
while( itr != str.end() ) {
tmp += *itr;
++itr;
}
const char* end_head = "</h1>";
while( *end_head != '\0' ) {
tmp.push_back( *end_head );
++end_head;
}
cout << tmp << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGxpc3Q+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3Mga2V5CnsKcHVibGljOgoJaW50IHNpemU7CglzdHJpbmcgcGF0OwoKCWtleSggc3RyaW5nIHNldF9rZXkgKSB7CgkJcGF0ID0gc2V0X2tleTsKCQlzaXplID0gcGF0LnNpemUoKTsKCX0KfTsKCmludCBtYWluKCkgCnsKCWtleSBobCgiIyMjIik7CglzdHJpbmcgc3RyID0gIiMjI2FiYyNkZWYiOwoJc3RyaW5nOjppdGVyYXRvciBpdHIgPSBzdHIuYmVnaW4oKTsKCgoJaW50IGNvdW50ID0gMDsKCWludCBpID0gMDsKCXdoaWxlKCBpdHIgIT0gc3RyLmVuZCgpICkgewoJCWlmICggaGwucGF0W2NvdW50XSA9PSAqaXRyICkgKytjb3VudDsKCQkrK2l0cjsKCX0KCglzdHJpbmcgdG1wID0gIjxoMT4iOwoJaXRyID0gc3RyLmJlZ2luKCkgKyBjb3VudDsKCXdoaWxlKCBpdHIgIT0gc3RyLmVuZCgpICkgewoJCXRtcCArPSAqaXRyOwoJCSsraXRyOwoJfQoJY29uc3QgY2hhciogZW5kX2hlYWQgPSAiPC9oMT4iOwoJCgl3aGlsZSggKmVuZF9oZWFkICE9ICdcMCcgKSB7CgkJdG1wLnB1c2hfYmFjayggKmVuZF9oZWFkICk7CgkJKytlbmRfaGVhZDsKCX0KCWNvdXQgPDwgdG1wIDw8IHN0ZDo6ZW5kbDsKCglyZXR1cm4gMDsKfQ==