100 atcoder#ABC282C. [ABC282C] String Delimiter
[ABC282C] String Delimiter
Score : points
Problem Statement
You are given a string of length consisting of lowercase English letters, ,, and ". It is guaranteed that contains an even number of ".
Let be the number of " in . For each , the characters from the -th " through the -th " are said to be enclosed.
Your task is to replace each , in that is not an enclosed character with . and print the resulting string.
Constraints
- is an integer between and , inclusive.
- is a string of length consisting of lowercase English letters,
,, and". - contains an even number of
".
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
8
"a,b"c,d
"a,b"c.d
In , "a,b" are enclosed characters, and c,d are not.
The , in that is not an enclosed character is the seventh character from the left in , so replace that character with . to get the answer.
5
,,,,,
.....
20
a,"t,"c,"o,"d,"e,"r,
a."t,"c."o,"d."e,"r.