Problem E
Password Filter
Languages
en
is

It is a regular occurrence that someone posts their password in a chat, email or other communications application. To prevent this the company you work at want to implement a password filter. It of course falls to you to implement that filter.
The filter takes in a string that is about to be sent out and replaces everything that could be a password with repetitions of the character *.
The string is first split into chunks separated by spaces. These chunks are then considered separately, and if a chunk could be a password it is replaced by the character * repeated as often as that chunk is long.
A chunk is considered a possible password if it contains both a letter and a digit.
Input
The first and only line of input contains the text that should be put through the filter. The input can contain all printable ASCII characters, except the only whitespace is spaces and a single newline character at the end. The first and last character (aside from the newline character) are not spaces. There is at most one space between chunks. There is at least one and at most 1000 letters aside from the newline character.
Output
Print the line in the input after the filter has been applied, as described above.
Sample Input 1 | Sample Output 1 |
---|---|
Hei hver er stadan a PRinu? |
Hei hver er stadan a PRinu? |
Sample Input 2 | Sample Output 2 |
---|---|
Lykilordid mitt er hunter2 |
Lykilordid mitt er ******* |