# Ambiguous Grammar demostration exercise

Hi im stuck on an exercise of ambiguous grammar. I need an example that shows that this grammar is ambiguous. The grammar is defined as follows:

$$S \rightarrow aT | bR$$ $$R \rightarrow a | aS | bRR$$ $$T \rightarrow b | bS | aTT$$

Thanks!

An example is the word $$aabbab$$.
We can either create it like this $$S \rightarrow aT \rightarrow aaTT \rightarrow aabST \rightarrow aabbRT \rightarrow aabbaT \rightarrow aabbab.$$ Or like this $$S \rightarrow aT \rightarrow aaTT \rightarrow aabT \rightarrow aabbS \rightarrow aabbaT \rightarrow aabbab.$$