#K95147. Simplify Text

    ID: 38799 Type: Default 1000ms 256MiB

Simplify Text

Simplify Text

You are given a string s. Your task is to remove any extra spaces from the string. This means that all consecutive spaces should be replaced by a single space, and any leading or trailing spaces should be removed.

For example, if the input is:

\texttt{\"This is a test.\"}

the output should be:

\texttt{\"This is a test.\"}

Make sure your program reads from standard input and writes to standard output.

inputFormat

The input consists of a single line containing the string s.

The string may contain multiple spaces between words as well as leading or trailing spaces.

Input is provided via standard input (stdin).

outputFormat

Output a single line of text - the simplified version of the string where all multiple spaces are replaced by one space and leading or trailing spaces are removed. The result must be printed to standard output (stdout).

## sample
This  is  a   test.
This is a test.