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

int main() {
	string a ="hello";
	string b = "Fellow $<world>$, full of $<smart>$ people";
	std::cout<<std::regex_replace(b, std::regex(R"(\$<[^<>]*>\$)"), a);
	return 0;
}