def markovc(input)
if not (input=~/I\*/)==nil
markovc(input.sub!(/I\*/, 'H*'))
end
if not (input=~/IH/)==nil
markovc(input.sub!(/IH/, 'HH'))
end
if not (input=~/HD/)==nil
markovc(input.sub!(/HD/, 'DEH'))
end
if not (input=~/ED/)==nil
markovc(input.sub!(/ED/, 'DE'))
end
if not (input=~/D/)==nil
markovc(input.sub!(/D/, ''))
end
if not (input=~/\*I/)==nil
markovc(input.sub!(/\*I/, 'D*'))
end
if not (input=~/H/)==nil
markovc(input.sub!(/H/, ''))
end
if not (input=~/\*/)==nil
markovc(input.sub!(/\*/, ''))
end
if not (input=~/E/)==nil
markovc(input.sub!(/E/, 'I'))
end
return input
end