(dotimes(x 1001)(print(*([rec(f x a b c)(if(= x 0)0(+(/ #0=(mod x b)c)(*(f(- x #0#)(+ a 1)(* a b)b)10)))]x 3 2 1)10)))