# Is the following CFG ambiguous?

I was given the following CFG :

$S \rightarrow A\ |\ B$

$A\rightarrow aAa\ |\ abAb\ |\ bAc\ |\ aca\ |\ abcb\ |\ bcc$

$B \rightarrow bBa\ |\ aBb\ |\ babBc\ |\ bca\ |\ acb\ |\ babcc$

And I have to show if it is ambiguous by giving two leftmost derivations for the same word.

I am pretty sure that there are two leftmost derivations but I can not find them.

I do not need the solution, just a tip where to start with would be enough.

• It seems this grammar is unambiguous after all. – Yuval Filmus Jun 18 '17 at 13:37
• I figured that out as well. I think I should start with A → abAb and end with bcc and start B → with aBb and end with babcc – Mattjo Jun 18 '17 at 14:36