Goal
Format a text file using the following rules:
* Only a single space between words (remove excessive spaces);
* No spaces before punctuation marks;
* One space after each punctuation mark in front of a letter;
* Use only lowercase letters, except for the beginning of the sentence (after a dot);
* Remove repeated punctuation marks.
A punctuation mark is a character other than a space, a letter or a digit.
Example
Input: "when a father gives to his son,,, Both laugh; When a son gives to his father, , , Both cry...shakespeare"
Output: "When a father gives to his son, both laugh; when a son gives to his father, both cry. Shakespeare"
Output
A line containing the Formatted text.
Constraints
The length of the input string is less than 1000.