This page is still under construction.

Parts of this page are still being built. What you see may change.

Garbled Message

Interview

Time limit1sMemory limit128 MB

Summary
Read lines of garbled text until EOF and replace every occurrence of the substring "iiing" with "th", preserving all other characters and line breaks.
Level

Easy2 of 10

Topics
String, Implementation, Simulation
Solved
No attempts yet

Problem

Obi-Wan has just sent an urgent message to the Jedi Temple, but subspace interference has garbled it: every occurrence of th in the original text was replaced with iiing. Reverse this substitution — replace every iiing back with th — to restore the original message.

Input

One or more lines of garbled text. Read every line until the end of input.

Output

The restored, original text: replace every iiing with th, and keep all other characters, line breaks, and whitespace exactly as they are.

Examples5

  1. Example 1

    Input
    Dariiing Bane restructured iiinge cult, so iiingat iiingere
    could only be two - no more, no less - a master, and an
    apprentice. Bane adopted cunning, subterfuge, and stealiiing as
    iiinge fundamental tenets of iiinge Siiiing order. Bane took an
    apprentice. When iiingat apprentice succeeded him, iiingat new
    Siiiing Lord would take an apprentice.
    
    Expected output
    Darth Bane restructured the cult, so that there
    could only be two - no more, no less - a master, and an
    apprentice. Bane adopted cunning, subterfuge, and stealth as
    the fundamental tenets of the Sith order. Bane took an
    apprentice. When that apprentice succeeded him, that new
    Sith Lord would take an apprentice.
    
  2. Example 2

    Input
    iiinge Siiiing Lord
    
    Expected output
    the Sith Lord
    
  3. Example 3

    Input
    iiingat is iiinge truiiing about iiinge Jedi
    
    Expected output
    that is the truth about the Jedi
    
  4. Example 4

    Input
    May iiinge Force be wiiiing you
    
    Expected output
    May the Force be with you
    
  5. Example 5

    Input
    iiingis is iiinge way
    iiingere is anoiiinger
    noiiinging more to say
    
    Expected output
    this is the way
    there is another
    nothing more to say