Sorry , I don't understand your meanning clearly.

Andrey Mokhov wrote:
1. Suppose, you have a contraction **"AB" -> "A and B"** and you meet in text string **AB**. According to the problem statement you should output **"A and B"** - not **"A AND B"**. Note, that if the contraction were **"Ab" -> "A and B"** than you would print **"A AND B"**, however.

According the problem, Each contraction may appear as listed, entirely uppercase, or capitalized (first letter uppercase, remaining letters as listed). The expansion should follow the same rule; if a contraction is uppercased, the expansion should be uppercased as well.

If I have a contraction "AB" -> " A and B"

when I input ab , I should output "a and b"?

AB, I should output "A AND B"?

Ab,, I should output "A and b"?

maybe I misunderstand the problem.

2. If you have two contractions **"AB C"->"A B and C"** and **"AB"->"A and B"** and analize string **AB C D ...** you shouldn't stop when you found match **AB** - you are to continue comparing because you will meet **AB C** which should be replaced as its contraction appear earlier in the input.

Andrey.

If more than one case applies, choose the earliest matching case in the list: "as listed," "uppercased," and "capitalized."

now we have two contractions.

1. "AB C" -> "A B and C"

2. "AB" ->"A and B"

iwhen I input AB C D, I search from 1 to C.

if some contraction matched , I used the rule?

Am I right?

Thx your reply