#include <iostream>
#include <regex>
#include <string>
using namespace std;
int main() {
auto input = "+1--12*123/+1234"s;
smatch sm;
if(regex_search(input, sm, regex{ "(?:^|\\b\\W)([+-]?\\d+)" })) {
do {
cout << sm[1] << endl;
input = sm.suffix().str();
} while(regex_search(input, sm, regex{ "(?:^\\W|\\b\\W)([+-]?\\d+)" }));
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8cmVnZXg+CiNpbmNsdWRlIDxzdHJpbmc+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKICAgIGF1dG8gaW5wdXQgPSAiKzEtLTEyKjEyMy8rMTIzNCJzOwogICAgc21hdGNoIHNtOwoKICAgIGlmKHJlZ2V4X3NlYXJjaChpbnB1dCwgc20sIHJlZ2V4eyAiKD86XnxcXGJcXFcpKFsrLV0/XFxkKykiIH0pKSB7CgogICAgICAgIGRvIHsKICAgICAgICAgICAgY291dCA8PCBzbVsxXSA8PCBlbmRsOwogICAgICAgICAgICBpbnB1dCA9IHNtLnN1ZmZpeCgpLnN0cigpOwogICAgICAgIH0gd2hpbGUocmVnZXhfc2VhcmNoKGlucHV0LCBzbSwgcmVnZXh7ICIoPzpeXFxXfFxcYlxcVykoWystXT9cXGQrKSIgfSkpOwogICAgfQp9