from itertools import cycle
from operator import sub


a = [2,1,2,3,2,3,4,3,4,5,4,5]
b = [1,0,1]
r = list(map(sub, a, cycle(b)))
print(r)
