Changyoung is learning to dance. A dance is a single line of steps separated by spaces, and it must follow these five rules.
dip may only be danced in one of these three situations:
jiggle (e.g. ... jiggle dip ...)jiggle (e.g. ... jiggle stomp dip ...)twirl (e.g. ... dip twirl ...)clap stomp clap.twirl is danced at least once, then hop must be danced at least once as well.jiggle.dip must be danced at least once.Given the dance Changyoung performed, write a program that determines whether it obeys all of the rules.
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.
Print one line for each test case.
form ok: followed by the dance exactly as given.form error K: followed by the dance, where K is the number of the broken rule.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.