Let N=a1a2…ac. Let us define a sequence of pair of integers by the following way. a0=N and b0=0.
{an+1≡an⋅N+bn(mod10c)bn+1=10can⋅N+bn−an+1
Let us show that bn<N, for n∈N. Use induction on n. For n=0, it is trivial.
bn+1<10c(an+1)N−an+1≤10c(an+1)N≤N.
Thus,
{bn≡10c⋅bn+1+an+1(modN)an=N10c+an+1−bn
Hence (an,bn) and (an+1,bn+1) define each other unambiguously. Since 0≤an,bn≤10c, the number of different pairs of (an,bn) is finite. Thus, (an,bn) is periodic sequence from the first term. Let (at,bt)=(a0,b0), then
M=at⋅10(t−1)c+at−1⋅10(t−2)c+⋯+a1
has a desired property. This shows that for each positive integer N there exists M that satisfies the conditions in the problem statement.