#include <string>
#include <iostream>
#include <regex>
using namespace std;

int main() {
	std::regex r(R"(\b(?!\d*(\d)\d*\1)\d+\b)");
	char *str = "1234567890 987 787";

	for (cregex_iterator it(str, str + strlen(str), r); it != cregex_iterator{}; it++)
    {
        cout << (*it).str() << endl;
    }
	return 0;
}
