#include <fstream>
#include <algorithm>
#include <iterator>
#include <iostream>
bool two_spaces(char c1, char c2)
{
        return c1 == ' ' && c2 == ' ';
}
int main()
{
// using std::cin for this demo
//    std::ifstream in_data("test.txt");
    std::istreambuf_iterator<char> beg(/*in_data*/ std::cin), end;
    std::string str;
    std::transform(beg, end, back_inserter(str), ::toupper);
    std::unique_copy(str.begin(), str.end(),
                    std::ostreambuf_iterator<char>(std::cout),
                    two_spaces);
}
