consider the sdts(using synthesized attributes)
s->aB {out "cat"}
s->bA {out "dog"}
B->aBB{out "pig"}
A->bAA{out "cow"}
B->b{out "deer"}
A->a{out "lion"}
the output for aabb is
a)cat pig deer deer b)cat dog pig lion c)cat cow deer lion d)cat deer dog pig