The input index at the beginning of each alternate is stored.