#include <iostream>
#include <regex>
#include <string>
using namespace std;
int main() {
string test = "##### stuff ## #";
string test2 = "##### stuff ## #";
int index;
while( (index = test.find("#")) != string::npos )
{
test.replace(index, 1, "hash");
}
while( (index = test2.find("##")) != string::npos )
{
test2.replace(index, 2, "hash");
}
cout<<test<<endl;
cout<<test2<<endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8cmVnZXg+CiNpbmNsdWRlIDxzdHJpbmc+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkKICAgIHN0cmluZyB0ZXN0ICA9ICIjIyMjIyBzdHVmZiAjIyAjIjsKICAgIHN0cmluZyB0ZXN0MiA9ICIjIyMjIyBzdHVmZiAjIyAjIjsKICAgIGludCBpbmRleDsKICAgIHdoaWxlKCAoaW5kZXggPSB0ZXN0LmZpbmQoIiMiKSkgIT0gc3RyaW5nOjpucG9zICkKICAgIHsKICAgICAgICB0ZXN0LnJlcGxhY2UoaW5kZXgsIDEsICJoYXNoIik7CiAgICB9CiAgICB3aGlsZSggKGluZGV4ID0gdGVzdDIuZmluZCgiIyMiKSkgIT0gc3RyaW5nOjpucG9zICkKICAgIHsKICAgICAgICB0ZXN0Mi5yZXBsYWNlKGluZGV4LCAyLCAiaGFzaCIpOwogICAgfQogICAgY291dDw8dGVzdDw8ZW5kbDsKICAgIGNvdXQ8PHRlc3QyPDxlbmRsOwogICAgCiAgICByZXR1cm4gMDsKfQ==