You could be inelegant, and get the count of the “a” array, and then increase a counter until the count and counter match, then apply tag.