The equations and are equivalent to
for nonnegative integers . Hence the language is
which is the nested two-pair count language generated by
It is therefore context-free.