#include <iostream>
#include <iomanip>

using namespace std;


int main()
{
    cin >> noskipws;
    char c = 0, f = 0;
    for(bool first = true; cin >> c; )
    {
        if (c == ' ')
        {
            first = true;
            cout << c;
        }
        else
            if (first)
            {
                first = false;
                cout << (f = c);
            }
            else
            {
                if (c != f) cout << c;
            }
    }
}
