#include <iostream>
#include <regex>

std::string condense (std::string str) {
	std::regex r("(.+)\\s+\\1");
	return regex_replace(str, r, "$1");
}

int main() {
	std::vector<std::string> lines = {"I heard the pastor sing live verses easily.",
									  "Deep episodes of Deep Space Nine came on the television only after the news.",
									  "Digital alarm clocks scare area children."};
	
	for (auto line : lines) std::cout << condense(line) << std::endl;
}