Sarkovskiĭ’s theorem for hereditarily decomposable chainable continua