An (l,m,n,k) kind Motzkin word is a
l+m+n-length word w
written with letters from {a,b,0,1,..,k-1} satisfying
- any prefix has at least as many occurrences of a as those of b
- w has l occurrences of a
and m occurrences of b
This Java applet generates (l,m,n,k) kind Motzkin words
in Gray code order: two successive words differ at most
in three positions.
Input: l, m<=l, n, k