#K79522. Clean and Filter Text

    ID: 35327 Type: Default 1000ms 256MiB

Clean and Filter Text

Clean and Filter Text

You are given a string consisting of words separated by spaces. Each word may begin with one or more special characters. Your task is to process the text according to the following rules:

  • For each word, remove all leading characters that are not alphabetical (i.e. not in a-z or A-Z).
  • If the resulting word does not contain any alphabetical letter, it should be removed entirely.
  • Finally, join the remaining words with a single space separating them.

For example, given the input "##hello ***world !good @morning", the output should be "hello world good morning".

inputFormat

The input is provided via standard input (stdin) and consists of a single line containing the text. The text may contain leading or trailing spaces and multiple spaces between words.

outputFormat

Print the cleaned text to standard output (stdout) as a single line. The cleaned text is obtained by processing each word as described in the problem statement.

## sample
##hello ***world !good @morning
hello world good morning