A. Interview with Oleg

Codeforces
IDCF738A
Time1000ms
Memory256MB
Difficulty
implementationstrings
Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string _s_ consisting of _n_ lowercase English letters. There is a filler word _ogo_ in Oleg's speech. All words that can be obtained from _ogo_ by adding _go_ several times to the end of it are also considered to be fillers. For example, the words _ogo_, _ogogo_, _ogogogo_ are fillers, but the words _go_, _og_, _ogog_, _ogogog_ and _oggo_ are not fillers. The fillers have maximal size, for example, for _ogogoo_ speech we can't consider _ogo_ a filler and _goo_ as a normal phrase. We should consider _ogogo_ as a filler here. To print the interview, Polycarp has to replace each of the fillers with three asterisks. Note that a filler word is replaced with exactly three asterisks regardless of its length. Polycarp has dealt with this problem in no time. Can you do the same? The clock is ticking! ## Input The first line contains a positive integer _n_ (1 ≤ _n_ ≤ 100) — the length of the interview. The second line contains the string _s_ of length _n_, consisting of lowercase English letters. ## Output Print the interview text after the replacement of each of the fillers with "_***_". It is allowed for the substring "_***_" to have several consecutive occurences. [samples] ## Note The first sample contains one filler word _ogogo_, so the interview for printing is "_a***b_". The second sample contains two fillers _ogo_ and _ogogogo_. Thus, the interview is transformed to "_***gmg***_".
Samples
Input #1
7
aogogob
Output #1
a***b
Input #2
13
ogogmgogogogo
Output #2
***gmg***
Input #3
9
ogoogoogo
Output #3
*********
API Response (JSON)
{
  "problem": {
    "name": "A. Interview with Oleg",
    "description": {
      "content": "Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string _s_ consisting of _n_ lowercase English letters.",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF738A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string _s_ consisting of _n_ lowercase English letters....",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments