public class Euler528 {
    static final long kMod = 1000000007L;

    static long modPow(long a, long e) {
        long r = 1 % kMod;
        a %= kMod;
        while (e > 0) {
            if ((e & 1) == 1)
                r = (r * a) % kMod;
            a = (a * a) % kMod;
            e >>= 1;
        }
        return r;
    }

    static long binomLargeNSmallK(long n, int k, long[] invFact) {
        if (k < 0)
            return 0;
        long nm = n % kMod;
        if (nm < k)
            return 0;
        long num = 1;
        for (int i = 0; i < k; i++) {
            num = (num * (nm - i)) % kMod;
        }
        return (num * invFact[k]) % kMod;
    }

    static long S(long n, int k, int b, long[] invFact) {
        int masks = 1 << k;
        long[] add = new long[k];
        long p = 1;
        for (int m = 1; m <= k; m++) {
            p *= b;
            add[m - 1] = p + 1;
        }

        long[] shift = new long[masks];
        for (int mask = 1; mask < masks; mask++) {
            int bit = Integer.numberOfTrailingZeros(mask);
            int prev = mask & (mask - 1);
            shift[mask] = shift[prev] + add[bit];
        }

        long ans = 0;
        for (int mask = 0; mask < masks; mask++) {
            long sh = shift[mask];
            if (sh > n)
                continue;
            long N = (n - sh) + k;
            long term = binomLargeNSmallK(N, k, invFact);
            if ((Integer.bitCount(mask) & 1) == 0) {
                ans += term;
                if (ans >= kMod)
                    ans -= kMod;
            } else {
                ans = (ans >= term) ? (ans - term) : (ans + kMod - term);
            }
        }
        return ans;
    }

    static long pow10(int e) {
        long r = 1;
        for (int i = 0; i < e; i++)
            r *= 10;
        return r;
    }

    public static void main(String[] args) {
        long[] fact = new long[16];
        long[] invFact = new long[16];
        fact[0] = 1;
        invFact[0] = 1;
        for (int i = 1; i <= 15; i++)
            fact[i] = (fact[i - 1] * i) % kMod;
        invFact[15] = modPow(fact[15], kMod - 2);
        for (int i = 15; i >= 1; i--) {
            invFact[i - 1] = (invFact[i] * i) % kMod;
        }

        long total = 0;
        for (int k = 10; k <= 15; k++) {
            long term = S(pow10(k), k, k, invFact);
            total = (total + term) % kMod;
        }
        System.out.println(total);
    }
}
