how to write program in ecos