def Restes(a,b,p): R=[] for n in range(21): u=a*n+b r=u%p R=R+[r] return R