I was trying to find the context-free grammar of
`$L= \{a^n b^m c^p d^q |m+n=p+q, n,m,p,q \geq0 \}$ but I'm stuck.
This is what I did so far:
$$ S \to X S Y | \lambda$$
$$X \to a|b$$
$$Y \to c|d
$$
but I figured out that it doesn't respect the order.
My Question is different from this one because here $n, m, p or q$ can be equal to $0$ which is not the case in the other question where the answer use $a, d >0$.