Dance

No attempts yetTime limit1sMemory limit128 MB

Problem

Changyoung is learning to dance. A dance is a single line of steps separated by spaces, and it must follow these five rules.

  1. A dip may only be danced in one of these three situations:
    • immediately after a jiggle (e.g. ... jiggle dip ...)
    • two steps after a jiggle (e.g. ... jiggle stomp dip ...)
    • immediately before a twirl (e.g. ... dip twirl ...)
  2. Every dance must end with clap stomp clap.
  3. If twirl is danced at least once, then hop must be danced at least once as well.
  4. A dance may not start with jiggle.
  5. dip must be danced at least once.

Given the dance Changyoung performed, write a program that determines whether it obeys all of the rules.

Input

The input consists of several test cases. Each test case is a single line containing one dance. A dance has at most 1000 steps; each step consists of lowercase letters only and is at most 100 characters long. Input continues until end of file.

Output

Print one line for each test case.

  • If the dance obeys every rule, print form ok: followed by the dance exactly as given.
  • If the dance breaks exactly one rule, print form error K: followed by the dance, where K is the number of the broken rule.
  • If the dance breaks two or more rules, print form errors K(1), K(2), ..., K(N-1) and K(N): followed by the dance. The broken rule numbers K(i) are listed in ascending order.

When printing the dance, every dip that breaks rule 1 (danced in an invalid position) must be printed in uppercase as DIP.