#include <iostream>
#include <regex>
#include <string>
using namespace std;
int main() {
std::string input_seq = "CCCC";
std::regex re("(?=(CCC)).");
std::sregex_iterator next(input_seq.begin(), input_seq.end(), re);
std::sregex_iterator end;
while (next != end) {
std::smatch match = *next;
std::cout << match.str(1) << "\t" << "\t" << match.position() << "\t" << "\n";
next++;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8cmVnZXg+CiNpbmNsdWRlIDxzdHJpbmc+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCXN0ZDo6c3RyaW5nIGlucHV0X3NlcSA9ICJDQ0NDIjsKCXN0ZDo6cmVnZXggcmUoIig/PShDQ0MpKS4iKTsKCXN0ZDo6c3JlZ2V4X2l0ZXJhdG9yIG5leHQoaW5wdXRfc2VxLmJlZ2luKCksIGlucHV0X3NlcS5lbmQoKSwgcmUpOwoJc3RkOjpzcmVnZXhfaXRlcmF0b3IgZW5kOwoJd2hpbGUgKG5leHQgIT0gZW5kKSB7CgkgICAgc3RkOjpzbWF0Y2ggbWF0Y2ggPSAqbmV4dDsKCSAgICBzdGQ6OmNvdXQgPDwgbWF0Y2guc3RyKDEpIDw8ICJcdCIgPDwgIlx0IiA8PCBtYXRjaC5wb3NpdGlvbigpIDw8ICJcdCIgPDwgIlxuIjsKCSAgICBuZXh0Kys7Cgl9CglyZXR1cm4gMDsKfQ==