def modx(x,n): m=int(x/n) mx=x-m*n return mx x1=modx(97,377) for i in range(10): x1=modx(97*x1,377) print(x1)