Exercise 7: generate Dyck words