S
/|\
/ | \
P V P
/| | |\
/ | | | \
A P ate A P
/ | | \
/ | | \
big Jim green cheese
S S
/ \ / \
S S S S
/|\ /|\ | / \
(S) (S) e S S
| | /|\ /|\
e e (S) (S)
| |
e e
An equivalent unambiguous grammar is as follows:If wy contains at least one a, then it can contain no c's. Therefore, vw2xy2z must contain at least n+1 a's and exactly n+2 c's, which is impossible if the string is in the language.
If wy contains no a's, then it must contain either b or c. Therefore,
vw0xy0z = vxz has either fewer than n+1 b's or
fewer than n+2 c's, but in either case exactly n a's, which is
impossible if the string is in the language.
If wy contains at least one a, then it can contain no c's. Therefore, vw0xy0z = vxz must contain less than n a's, but exactly n c's, which is impossible if the string is in the language.
If wy contains no a's, then vw2xy2z contains either more than n b's or more than n c's, but exactly n a's, which is impossible if the string is in the language.