#include <iostream>
#include <string>
#include <cctype>

int main() {
    std::string wyrazenie;
    std::getline(std::cin, wyrazenie);

    std::string tmp;

    for (int i = 0; i < wyrazenie.length(); ++i) {

        if (!std::isspace(wyrazenie[i])) {
            tmp += wyrazenie[i];

        } else {
            std::cout << tmp << std::endl;
            tmp.clear();
        }
    }
    std::cout << "Final temp:" << tmp << std::endl;
}
