write sequence list using C++