allIndex_A = [1, 2, 8, 12, 17, 21, 23, 29]
allIndex_B = [3, 5, 7, 9, 11, 13, 15, 18, 20, 22, 24, 26, 28, 30]
allIndex_C = [4, 6, 10, 14, 16, 19, 25, 27]
ita, itb, itc = iter(allIndex_A), iter(allIndex_B), iter(allIndex_C)
b = c = allIndex_A[0]
newList = []
try:
while True:
a = next(ita)
while b <= a:
b = next(itb)
while c <= a:
c = next(itc)
newList.append([a, b, c])
except StopIteration:
print(newList)