import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {
    static int MOD = 1000000007;

    // After writing solution, quick scan for:
    //   array out of bounds
    //   special cases e.g. n=1?
    //
    // Big numbers arithmetic bugs:
    //   int overflow
    //   sorting, or taking max, after MOD
    void solve() throws IOException {
        char[] numstr = rs();
        int n = numstr.length;
        long[] num = new long[n];
        for (int i = 0; i < n; i++) num[i] = numstr[i] - '0';

        // dp1[i] is sum of possible nums for num[0..i]
        // dp2[i] is number of numbers of dp1[i]

        // dp3[i] is sum of possible nums for num[0..i] where i must be removed

        // dp5[i] is the actual number num[0..i]

        long[][] dp = new long[n][5];
        dp[0][0] = 0;
        dp[0][1] = 1;
        dp[0][2] = 0;
        dp[0][3] = 1;
        dp[0][4] = num[0];
        for (int i = 1; i < n; i++) {
            // keep self remove somewhere before
            // kill self keep all before
            // kill self and suffix before
            dp[i][0] = dp[i-1][0]*10%MOD + dp[i-1][1]*num[i]%MOD + dp[i-1][4] + dp[i-1][2];
            dp[i][1] = dp[i-1][1]+i+1;
            dp[i][2] = dp[i-1][4] + dp[i-1][2];
            dp[i][4] = dp[i-1][4] * 10 + num[i];

            dp[i][0] %= MOD;
            dp[i][1] %= MOD;
            dp[i][2] %= MOD;
            dp[i][4] %= MOD;
        }

        pw.println(dp[n-1][0]);
    }

    // Template code below

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        Main m = new Main();
        m.solve();
        m.close();
    }

    void close() throws IOException {
        pw.flush();
        pw.close();
        br.close();
    }

    int ri() throws IOException {
        return Integer.parseInt(br.readLine().trim());
    }

    long rl() throws IOException {
        return Long.parseLong(br.readLine().trim());
    }

    int[] ril(int n) throws IOException {
        int[] nums = new int[n];
        int c = 0;
        for (int i = 0; i < n; i++) {
            int sign = 1;
            c = br.read();
            int x = 0;
            if (c == '-') {
                sign = -1;
                c = br.read();
            }
            while (c >= '0' && c <= '9') {
                x = x * 10 + c - '0';
                c = br.read();
            }
            nums[i] = x * sign;
        }
        while (c != '\n' && c != -1) c = br.read();
        return nums;
    }

    long[] rll(int n) throws IOException {
        long[] nums = new long[n];
        int c = 0;
        for (int i = 0; i < n; i++) {
            int sign = 1;
            c = br.read();
            long x = 0;
            if (c == '-') {
                sign = -1;
                c = br.read();
            }
            while (c >= '0' && c <= '9') {
                x = x * 10 + c - '0';
                c = br.read();
            }
            nums[i] = x * sign;
        }
        while (c != '\n' && c != -1) c = br.read();
        return nums;
    }

    int[] rkil() throws IOException {
        int sign = 1;
        int c = br.read();
        int x = 0;
        if (c == '-') {
            sign = -1;
            c = br.read();
        }
        while (c >= '0' && c <= '9') {
            x = x * 10 + c - '0';
            c = br.read();
        }
        return ril(x);
    }

    long[] rkll() throws IOException {
        int sign = 1;
        int c = br.read();
        int x = 0;
        if (c == '-') {
            sign = -1;
            c = br.read();
        }
        while (c >= '0' && c <= '9') {
            x = x * 10 + c - '0';
            c = br.read();
        }
        return rll(x);
    }

    char[] rs() throws IOException {
        return br.readLine().toCharArray();
    }

    void sort(int[] A) {
        Random r = new Random();
        for (int i = A.length-1; i > 0; i--) {
            int j = r.nextInt(i+1);
            int temp = A[i];
            A[i] = A[j];
            A[j] = temp;
        }
        Arrays.sort(A);
    }
}


import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    static final long mod = (long)1e9+7;
    static long power(long x,long y){
        long res = 1;
        while(y > 0){
            if(y%2 == 1)res = (res * x)%mod;
            y >>= 1;
            x = (x*x)%mod;
        }
        return res;
    }
    static long mul(long a,long b){
        return (a*b)%mod;
    }
    static long add(long a,long b){
        return (a + b)%mod;
    }
    static long choose(long x){
        return mul(x,mul(x+1,power(2,mod-2)));
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] num = sc.next().toCharArray();
        int n = num.length;
        long pre[] = new long[n];
        pre[n-1] = 0;
        for(int i = n-2; i>=0; i--){
            int term = n-i-2;
            pre[i] = add(pre[i+1],mul(term+1,power(10*1l,term)));
        }
        long ans = 0;
        for(int i = n-1; i>=0; i--){
            long number = num[i]-'0';
            ans  = add(ans,mul(choose(i),mul(number,power(10*1l,n-i-1))));
            ans = add(ans,mul(number,pre[i]));
        }
        System.out.println(ans);
    }
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.concurrent.TimeUnit;

public class c1422 implements Runnable{

    public static void main(String[] args) {
    	try{
            new Thread(null, new c1422(), "process", 1<<26).start();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		//int t = scan.nextInt();
		int t = 1;
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int oo = Integer.MAX_VALUE;
		static final long OO = Long.MAX_VALUE;
		static long MOD = 1000000007;

		public void solve(int testNumber, FastReader sc, PrintWriter out) {
			String N = sc.nextLine();

			long sum = 0;
			long possibleBefore = 0;
			for(int i = 1; i < N.length(); i++) {
				possibleBefore += i;
				possibleBefore %= MOD;
			}

			long powTen = 1;
			for(int i = N.length()-1; i >= 0; i--) {
				sum += powTen * (N.charAt(i) - 48) * possibleBefore;
				sum %= MOD;
				powTen *= 10;
				powTen %= MOD;
				possibleBefore -= i;
				possibleBefore %= MOD;
				if(possibleBefore < 0)
					possibleBefore += MOD;
			}

			//dbg(sum);

			powTen = 1;
			long count = 0;
			for(int i = N.length()-1; i >= 0; i--) {
				sum += (count * (N.charAt(i) - 48));
				sum %=MOD;
				count += (N.length() - i) * powTen;
				count %= MOD;
				powTen *= 10;
				powTen %=MOD;
			}

			out.println(sum);
		}

	}
	static long modInverse(long N, long MOD) {
		return binpow(N, MOD - 2, MOD);
	}
	static long modDivide(long a, long b, long MOD) {
		a %= MOD;
		return (binpow(b, MOD-2, MOD) * a) % MOD;
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static int[] reverse(int a[])
    {
        int[] b = new int[a.length];
        for (int i = 0, j = a.length; i < a.length; i++, j--) {
            b[j - 1] = a[i];
        }

        return b;
    }
	static long[] reverse(long a[])
    {
        long[] b = new long[a.length];
        for (int i = 0, j = a.length; i < a.length; i++, j--) {
            b[j - 1] = a[i];
        }

        return b;
    }

	static void shuffle(Object[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			Object temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void sort(Object[] x){
		shuffle(x);
		Arrays.sort(x);
	}

	static class tup implements Comparable<tup>, Comparator<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		public tup() {
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(b,o.b);
		}
		@Override
		public int compare(tup o1, tup o2) {
			return Integer.compare(o1.b, o2.b);
		}

		@Override
	    public int hashCode() {
			return Objects.hash(a, b);
	    }

	    @Override
	    public boolean equals(Object obj) {
	    	if (this == obj)
                return true;
	    	if (obj == null)
                return false;
	    	if (getClass() != obj.getClass())
                return false;
	    	tup other = (tup) obj;
	    	return a==other.a && b==other.b;
	    }

	    @Override
	    public String toString() {
	    	return a + " " + b;
	    }
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		int[] readArray(int size) {
			int[] a = new int[size];
			for(int i = 0; i < size; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		long[] readLongArray(int size) {
			long[] a = new long[size];
			for(int i = 0; i < size; i++) {
				a[i] = nextLong();
			}
			return a;
		}
	}

	static void dbg(int[] arr) {
		System.out.println(Arrays.toString(arr));
	}
	static void dbg(long[] arr) {
		System.out.println(Arrays.toString(arr));
	}
	static void dbg(boolean[] arr) {
		System.out.println(Arrays.toString(arr));
	}

	static void dbg(Object... args) {
        for (Object arg : args)
            System.out.print(arg + " ");
        System.out.println();
    }
}


import java.util.*;
import java.io.*;
import java.math.BigInteger;
import java.text.DecimalFormat;
public class Mamo {
    static long mod=1000000007;
    static Reader in=new Reader();
    static List<Integer >G[];
	static long a[]=new long[2000001];
    static StringBuilder Sd=new StringBuilder(),Sl=new StringBuilder();
    public static void main(String [] args) {
    	//Dir by MohammedElkady

       String n=in.s();
    	long ans=0, sum=0,mult=1,ll=0;
    for(char c:n.toCharArray())
    	sum+=c-'0';
    for(long i =n.length()-1;i>0;i--) {
    	long x=n.charAt((int)i)-'0';
    	long num=((i)*(i+1))/2;

    	num%=mod;
    	long lop=x*num;
    	lop%=mod;
    	ll++;
    	sum-=x;
    	ans+=(lop*mult);
    	ans+=ll*(sum*mult);
    	ans%=mod;
    	mult*=10;
    	mult%=mod;
    }
    ans%=mod;
    out.append(ans+" ");
 out.close();
    }
    static long ans=0L;
    static boolean v[];
    static ArrayList<Integer>res;
    static  Queue <Integer> pop;
    static  Stack <Integer>rem;
    public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
    static long gcd(long g,long x){if(x<1)return g;else return gcd(x,g%x);}
    static class Reader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];}
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;}
        public String s(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();}
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;}
        public int nextInt(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;}
        public double d() throws IOException {return Double.parseDouble(s()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
        public int[] arr(int n){int[] ret = new int[n];for (int i = 0; i < n; i++) {ret[i] = nextInt();}return ret;}
    }
}

class node implements Comparable<node> {
int a;
int b;
node(int tt,int ll){
a=tt;b=ll;
}
@Override
public int compareTo(node o) {
	 return b-o.b;
}

}
class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
}

class Sorting{

 public static long[] bucketSort(long[] array, int bucketCount) {

 if (bucketCount <= 0) throw new IllegalArgumentException("Invalid bucket count");

 if (array.length <= 1) return array; //trivially sorted

 long high = array[0];

 long low = array[0];

 for (int i = 1; i < array.length; i++) { //find the range of input elements

 if (array[i] > high) high = array[i];

 if (array[i] < low) low = array[i];

 }

 double interval = ((double)(high - low + 1))/bucketCount; //range of one bucket

 ArrayList<Long> buckets[] = new ArrayList[bucketCount];

 for (int i = 0; i < bucketCount; i++) { //initialize buckets

 buckets[i] = new ArrayList();

 }

 for (int i = 0; i < array.length; i++) { //partition the input array

 buckets[(int)((array[i] - low)/interval)].add(array[i]);

 }

 int pointer = 0;

 for (int i = 0; i < buckets.length; i++) {

 Collections.sort(buckets[i]); //mergeSort

 for (int j = 0; j < buckets[i].size(); j++) { //merge the buckets

 array[pointer] = buckets[i].get(j);

 pointer++;

 }

}

return array;

}
}


import java.util.*;
import java.io.*;
import java.math.BigInteger;
import java.text.DecimalFormat;
public class Mamo {
    static long mod=1000000007;
    static Reader in=new Reader();
    static List<Integer >G[];
	static long a[]=new long[2000001];
    static StringBuilder Sd=new StringBuilder(),Sl=new StringBuilder();
    public static void main(String [] args) {
    	//Dir by MohammedElkady

       String n=in.s();
    	long ans=0, sum=0,mult=1,ll=0;

    for(char c:n.toCharArray())
    	sum+=c-'0';
    for(long i =n.length()-1;i>0;i--) {
    	long x=n.charAt((int)i)-'0';
    	long num=((i)*(i+1))/2;

    	num%=mod;
    	long lop=x*num;
    	lop%=mod;
    	lop*=mult;
    	lop%=mod;

    	ll++;
    	sum-=x;
    	long lok=ll*sum;
    	lok%=mod;
    	lok*=mult;
    	lok%=mod;
    	ans+=(lop);
    	ans%=mod;
    	ans+=lok;
    	ans%=mod;
    	mult*=10;
    	mult%=mod;
    }
    ans%=mod;
    out.append(ans+" ");
 out.close();
    }
    static long ans=0L;
    static boolean v[];
    static ArrayList<Integer>res;
    static  Queue <Integer> pop;
    static  Stack <Integer>rem;
    public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
    static long gcd(long g,long x){if(x<1)return g;else return gcd(x,g%x);}
    static class Reader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];}
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;}
        public String s(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();}
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;}
        public int nextInt(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;}
        public double d() throws IOException {return Double.parseDouble(s()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
        public int[] arr(int n){int[] ret = new int[n];for (int i = 0; i < n; i++) {ret[i] = nextInt();}return ret;}
    }
}

class node implements Comparable<node> {
int a;
int b;
node(int tt,int ll){
a=tt;b=ll;
}
@Override
public int compareTo(node o) {
	 return b-o.b;
}

}
class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
}

class Sorting{

 public static long[] bucketSort(long[] array, int bucketCount) {

 if (bucketCount <= 0) throw new IllegalArgumentException("Invalid bucket count");

 if (array.length <= 1) return array; //trivially sorted

 long high = array[0];

 long low = array[0];

 for (int i = 1; i < array.length; i++) { //find the range of input elements

 if (array[i] > high) high = array[i];

 if (array[i] < low) low = array[i];

 }

 double interval = ((double)(high - low + 1))/bucketCount; //range of one bucket

 ArrayList<Long> buckets[] = new ArrayList[bucketCount];

 for (int i = 0; i < bucketCount; i++) { //initialize buckets

 buckets[i] = new ArrayList();

 }

 for (int i = 0; i < array.length; i++) { //partition the input array

 buckets[(int)((array[i] - low)/interval)].add(array[i]);

 }

 int pointer = 0;

 for (int i = 0; i < buckets.length; i++) {

 Collections.sort(buckets[i]); //mergeSort

 for (int j = 0; j < buckets[i].size(); j++) { //merge the buckets

 array[pointer] = buckets[i].get(j);

 pointer++;

 }

}

return array;

}
}


import java.io.*;
import java.util.*;

public class Bargain {

	static long mod = (long)1e9+7;

	static long seriesSum(int n){
		return ((n*(n+1))/2)%mod;
	}

	static long pow(int n){
		long ans = 1;
		for(int i=0;i<n;i++){
			ans = (ans*10)%mod;
		}
		return ans;
	}
	public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;
        while(t-->0) {
            char ch[] = in.next().toCharArray();
			int n = ch.length;
			long ans = 0;
			//left side of ch[i]
			for(int i=0;i<n;i++){
				int k = ch[i]-'0';
				long contribution = (k*pow(n-i-1))%mod;
				long contributionFreq = seriesSum(i);
				ans = (ans+(contribution*contributionFreq)%mod)%mod;
			}
			//right side of ch[i]
			long sumOfMagnitudeOfContributions = 0;
			int ind = 1;
			for(int i=n-2;i>=0;i--){
				int k = ch[i]-'0';
				long contribution = pow(ind-1);
				long contributionFreq = ind; ind++;
				sumOfMagnitudeOfContributions = (sumOfMagnitudeOfContributions+(contribution*contributionFreq)%mod)%mod;
				ans = (ans+(k*sumOfMagnitudeOfContributions)%mod)%mod;
			}
			out.println(ans);
         }
        out.flush();
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while(!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				}catch(IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] readArray(int n) {
			int a[] = new int[n];
			for(int i=0;i<n;i++) a[i] = nextInt();
			return a;
		}
	}
}


import java.io.*;
import java.util.*;

public class Bargain {

	static long mod = (long)1e9+7;

	static long seriesSum(int n){
		return ((n*(n+1))/2)%mod;
	}
	public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;
        while(t-->0) {
            char ch[] = in.next().toCharArray();
			int n = ch.length;
			long ans = 0;
			long pow = 1;
			//left side of ch[i]
			for(int i=n-1;i>=0;i--){
				int k = ch[i]-'0';
				long contribution = (k*pow)%mod;
				pow = (pow*10)%mod;
				long contributionFreq = seriesSum(i);
				ans = (ans+(contribution*contributionFreq)%mod)%mod;
			}
			//right side of ch[i]
			long sumOfMagnitudeOfContributions = 0;
			int ind = 1;
			pow = 1;
			for(int i=n-2;i>=0;i--){
				int k = ch[i]-'0';
				long contribution = pow;
				long contributionFreq = ind; ind++;
				pow = (pow*10)%mod;
				sumOfMagnitudeOfContributions = (sumOfMagnitudeOfContributions+(contribution*contributionFreq)%mod)%mod;
				ans = (ans+(k*sumOfMagnitudeOfContributions)%mod)%mod;
			}
			out.println(ans);
         }
        out.flush();
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while(!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				}catch(IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] readArray(int n) {
			int a[] = new int[n];
			for(int i=0;i<n;i++) a[i] = nextInt();
			return a;
		}
	}
}


import java.io.*;
import java.util.*;

public class Bargain {

	static long mod = (long)1e9+7;

	static long seriesSum(int n){
		return (((long)n*(n+1))/2)%mod;
	}
	public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;
        while(t-->0) {
            char ch[] = in.next().toCharArray();
			int n = ch.length;
			long ans = 0;
			long pow = 1;
			//left side of ch[i]
			for(int i=n-1;i>=0;i--){
				int k = ch[i]-'0';
				long contribution = (k*pow)%mod;
				pow = (pow*10)%mod;
				long contributionFreq = seriesSum(i);
				ans = (ans+(contribution*contributionFreq)%mod)%mod;
			}
			//right side of ch[i]
			long sumOfMagnitudeOfContributions = 0;
			int ind = 1;
			pow = 1;
			for(int i=n-2;i>=0;i--){
				int k = ch[i]-'0';
				long contribution = pow;
				long contributionFreq = ind; ind++;
				pow = (pow*10)%mod;
				sumOfMagnitudeOfContributions = (sumOfMagnitudeOfContributions+(contribution*contributionFreq)%mod)%mod;
				ans = (ans+(k*sumOfMagnitudeOfContributions)%mod)%mod;
			}
			out.println(ans);
         }
        out.flush();
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while(!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				}catch(IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] readArray(int n) {
			int a[] = new int[n];
			for(int i=0;i<n;i++) a[i] = nextInt();
			return a;
		}
	}
}


import java.io.*;
import java.util.*;

public class Bargain {

	static long mod = (long)1e9+7;

	static long seriesSum(int n){
		return ((n*(n+1))/2)%mod;
	}

	static long pow(int n){
		long ans = 1;
		for(int i=0;i<n;i++){
			ans = (ans*10)%mod;
		}
		return ans;
	}
	public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;
        while(t-->0) {
            char ch[] = in.next().toCharArray();
			int n = ch.length;
			long ans = 0;
			long pow = pow(n-1);
			//left side of ch[i]
			for(int i=0;i<n;i++){
				int k = ch[i]-'0';
				long contribution = (k*pow)%mod;
				pow = (pow/10);
				long contributionFreq = seriesSum(i);
				ans = (ans+(contribution*contributionFreq)%mod)%mod;
			}
			//right side of ch[i]
			long sumOfMagnitudeOfContributions = 0;
			int ind = 1;
			pow = 1;
			for(int i=n-2;i>=0;i--){
				int k = ch[i]-'0';
				long contribution = pow;
				long contributionFreq = ind; ind++;
				pow = (pow*10)%mod;
				sumOfMagnitudeOfContributions = (sumOfMagnitudeOfContributions+(contribution*contributionFreq)%mod)%mod;
				ans = (ans+(k*sumOfMagnitudeOfContributions)%mod)%mod;
			}
			out.println(ans);
         }
        out.flush();
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while(!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				}catch(IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] readArray(int n) {
			int a[] = new int[n];
			for(int i=0;i<n;i++) a[i] = nextInt();
			return a;
		}
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * @author rozerhacks
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "rozerhacks", 1 << 29);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            CBargain solver = new CBargain();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class CBargain {
        Modular md = new Modular(1000000007);
        Power pw = new Power(md);

        public int findIt(int n) {
            int ans = 0;
            ans = md.add(ans, md.mul(md.mul(9, pw.pow(10, n)), n));
            ans = md.subtract(ans, pw.pow(10, n));
            ans = md.add(ans, 1);
            ans = md.mul(ans, pw.inverse(81));
            return ans;
        }

        public void solve(int testNumber, FastInput in, FastOutput out) {
            char[] ar = in.readString().toCharArray();
            int ans = 0;
            for (int i = 0, remaining = ar.length - 1; i < ar.length; i++, remaining--) {
                ans = md.add(ans, md.mul(ar[i] - '0', findIt(remaining)));
                long prev = (i * (i + 1l)) / 2;
                ans = md.add(ans, md.mul(md.mul(prev, ar[i] - '0'), pw.pow(10, remaining)));
            }
            out.println(ans);

        }

    }

    static class Power {
        private final Modular modular;

        public Power(Modular modular) {
            this.modular = modular;
        }

        public int pow(int x, int y) {
            long r = modular.valueOf(1);
            while (y > 0) {
                if ((y & 1) == 1) r = modular.valueOf(r * x);
                x = modular.mul(x, x);
                y >>= 1;
            }
            return modular.valueOf(r);
        }

        public int inverse(int x) {
            return pow(x, modular.getMod() - 2);
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private final Writer os;
        private final StringBuilder cache = new StringBuilder(5 << 20);

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        public FastOutput append(char c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            return this;
        }

        public FastOutput println(int c) {
            return append(c).println();
        }

        public FastOutput println() {
            cache.append(System.lineSeparator());
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class FastInput {
        private final InputStream is;
        private final StringBuilder defaultStringBuf = new StringBuilder(1 << 13);
        private final byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public String readString(StringBuilder builder) {
            skipBlank();

            while (next > 32) {
                builder.append((char) next);
                next = read();
            }

            return builder.toString();
        }

        public String readString() {
            defaultStringBuf.setLength(0);
            return readString(defaultStringBuf);
        }

    }

    static class Modular {
        private final int mod;

        public Modular(int mod) {
            this.mod = mod;
        }

        public Modular(long mod) {
            this((int) mod);
            if (this.mod != mod) throw new IllegalArgumentException();
        }

        public Modular(double mod) {
            this((int) mod);
            if (this.mod != mod) throw new IllegalArgumentException();
        }

        public int getMod() {
            return this.mod;
        }

        public int valueOf(int x) {
            x %= mod;
            if (x < 0) x += mod;
            return x;
        }

        public int valueOf(long x) {
            x %= mod;
            if (x < 0) x += mod;
            return (int) x;
        }

        public int mul(int x, int y) {
            return valueOf((long) x * y);
        }

        public int mul(long x, long y) {
            return valueOf(x * y);
        }

        public int add(int x, int y) {
            return valueOf(x + y);
        }

        public int subtract(int x, int y) {
            return valueOf(x - y);
        }

        public String toString() {
            return "Mod : " + mod;
        }

    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
import java.util.LinkedList;
import java.util.Queue;
public final class codeforces
{
    static StringBuilder ans=new StringBuilder();
    static FastReader in=new FastReader();
    static ArrayList<ArrayList<Integer>> g;
    static long mod=1000000007;
    static boolean set[];
    public static void main(String args[])throws IOException
    {
        String X=in.next();
        int N=X.length();

        long pow=1;
        long s=0;
        long sum=0;
        pow=1;
        for(int i=N-1; i>=0; i--)
        {
            int c=X.charAt(i)-'0';
            long r=( (i*(i+1)/2)%mod   * pow%mod  +sum%mod)%mod;
            sum=(sum%mod + pow*(N-i)%mod)%mod;
            pow=(pow*10)%mod;
            s=(s%mod + c*r%mod)%mod;
        }
        System.out.println(s);

    }

    static int sD(long n)
    {

        if (n % 2 == 0 )
            return 2;

        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0 )
                return i;
        }

        return (int)n;
    }

    static void setGraph(int N)
    {
        set=new boolean[N+1];
        g=new ArrayList<ArrayList<Integer>>();
        for(int i=0; i<=N; i++)
            g.add(new ArrayList<Integer>());
    }

    static void DFS(int N,int d)
    {
        set[N]=true;
        d++;
        for(int i=0; i<g.get(N).size(); i++)
        {
            int c=g.get(N).get(i);
            if(set[c]==false)
            {
                DFS(c,d);
            }
        }
    }

    static  long pow(long a,long b)
    {
        long mod=1000000007;
        long pow=1;
        long x=a;
        while(b!=0)
        {
            if((b&1)!=0)pow=(pow*x)%mod;
            x=(x*x)%mod;
            b/=2;
        }
        return pow;
    }

    static long toggleBits(long x)//one's complement || Toggle bits
    {
        int n=(int)(Math.floor(Math.log(x)/Math.log(2)))+1;

        return ((1<<n)-1)^x;
    }

    static int countBits(long a)
    {
        return (int)(Math.log(a)/Math.log(2)+1);
    }

    static long fact(long N)
    {
        long n=2;
        if(N<=1)return 1;
        else
        {
            for(int i=3; i<=N; i++)n=(n*i)%mod;
        }
        return n;
    }

    static int kadane(int A[])
    {
        int lsum=A[0],gsum=A[0];
        for(int i=1; i<A.length; i++)
        {
            lsum=Math.max(lsum+A[i],A[i]);
            gsum=Math.max(gsum,lsum);
        }
        return gsum;
    }

    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

    static boolean isPrime(long N)
    {
        if (N<=1)  return false;
        if (N<=3)  return true;
        if (N%2 == 0 || N%3 == 0) return false;
        for (int i=5; i*i<=N; i=i+6)
            if (N%i == 0 || N%(i+2) == 0)
                return false;
        return true;
    }

    static int i()
    {
        return in.nextInt();
    }

    static long l()
    {
        return in.nextLong();
    }

    static int[] input(int N){
        int A[]=new int[N];
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] inputLong(int N)     {
        long A[]=new long[N];
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static long GCD(long a,long b)
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        br=new BufferedReader(new InputStreamReader(System.in));
    }

    String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try
            {
                st=new StringTokenizer(br.readLine());
            }
            catch(IOException e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str="";
        try
        {
            str=br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
import java.util.LinkedList;
import java.util.Queue;
public final class codeforces
{
    static StringBuilder ans=new StringBuilder();
    static FastReader in=new FastReader();
    static ArrayList<ArrayList<Integer>> g;
    static long mod=1000000007;
    static boolean set[];
    public static void main(String args[])throws IOException
    {
        String X=in.next();
        int N=X.length();

        long pow=1;
        long s=0;
        long sum=0;
        pow=1;
        for(int i=N-1; i>=0; i--)
        {
            int c=X.charAt(i)-'0';
           long r=(i*(i+1)/2 %mod *pow %mod +sum)%mod;
          sum=(sum+pow*(N-i)%mod)%mod;
          pow=(pow*10)%mod;
          s=(s+c*r%mod)%mod;
        }
        System.out.println(s);

    }

    static int sD(long n)
    {

        if (n % 2 == 0 )
            return 2;

        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0 )
                return i;
        }

        return (int)n;
    }

    static void setGraph(int N)
    {
        set=new boolean[N+1];
        g=new ArrayList<ArrayList<Integer>>();
        for(int i=0; i<=N; i++)
            g.add(new ArrayList<Integer>());
    }

    static void DFS(int N,int d)
    {
        set[N]=true;
        d++;
        for(int i=0; i<g.get(N).size(); i++)
        {
            int c=g.get(N).get(i);
            if(set[c]==false)
            {
                DFS(c,d);
            }
        }
    }

    static  long pow(long a,long b)
    {
        long mod=1000000007;
        long pow=1;
        long x=a;
        while(b!=0)
        {
            if((b&1)!=0)pow=(pow*x)%mod;
            x=(x*x)%mod;
            b/=2;
        }
        return pow;
    }

    static long toggleBits(long x)//one's complement || Toggle bits
    {
        int n=(int)(Math.floor(Math.log(x)/Math.log(2)))+1;

        return ((1<<n)-1)^x;
    }

    static int countBits(long a)
    {
        return (int)(Math.log(a)/Math.log(2)+1);
    }

    static long fact(long N)
    {
        long n=2;
        if(N<=1)return 1;
        else
        {
            for(int i=3; i<=N; i++)n=(n*i)%mod;
        }
        return n;
    }

    static int kadane(int A[])
    {
        int lsum=A[0],gsum=A[0];
        for(int i=1; i<A.length; i++)
        {
            lsum=Math.max(lsum+A[i],A[i]);
            gsum=Math.max(gsum,lsum);
        }
        return gsum;
    }

    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

    static boolean isPrime(long N)
    {
        if (N<=1)  return false;
        if (N<=3)  return true;
        if (N%2 == 0 || N%3 == 0) return false;
        for (int i=5; i*i<=N; i=i+6)
            if (N%i == 0 || N%(i+2) == 0)
                return false;
        return true;
    }

    static int i()
    {
        return in.nextInt();
    }

    static long l()
    {
        return in.nextLong();
    }

    static int[] input(int N){
        int A[]=new int[N];
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] inputLong(int N)     {
        long A[]=new long[N];
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static long GCD(long a,long b)
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        br=new BufferedReader(new InputStreamReader(System.in));
    }

    String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try
            {
                st=new StringTokenizer(br.readLine());
            }
            catch(IOException e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str="";
        try
        {
            str=br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
import java.util.LinkedList;
import java.util.Queue;
public final class codeforces
{
    static StringBuilder ans=new StringBuilder();
    static FastReader in=new FastReader();
    static ArrayList<ArrayList<Integer>> g;
    static long mod=1000000007;
    static boolean set[];
    public static void main(String args[])throws IOException
    {
        String X=in.next();
        int N=X.length();
        long A[]=new long[N];
        int c=2;
        long pow=1;
        A[N-1]=1;
        for(int i=N-2; i>=0; i--)
        {
            pow=(pow*10)%mod;
            A[i]=((pow*c)%mod+A[i+1]%mod)%mod;
            c++;
            // System.out.println(A[i]);
        }
        long s=0;

        for(int i=N-1; i>=0; i--)
        {
            long r=((i*(i+1))/2)%mod;
            int ch=X.charAt(i)-'0';
            pow=pow(10,N-i-1)%mod;
            r=(r*pow*ch)%mod;
            s=(s%mod+r%mod)%mod;
            int l=i+1;
            if(l<N)
            {
                r=(A[l]*ch)%mod;
                s=(s%mod+r%mod)%mod;
            }

        }
        System.out.println(s);

    }

    static int sD(long n)
    {

        if (n % 2 == 0 )
            return 2;

        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0 )
                return i;
        }

        return (int)n;
    }

    static void setGraph(int N)
    {
        set=new boolean[N+1];
        g=new ArrayList<ArrayList<Integer>>();
        for(int i=0; i<=N; i++)
            g.add(new ArrayList<Integer>());
    }

    static void DFS(int N,int d)
    {
        set[N]=true;
        d++;
        for(int i=0; i<g.get(N).size(); i++)
        {
            int c=g.get(N).get(i);
            if(set[c]==false)
            {
                DFS(c,d);
            }
        }
    }

    static  long pow(long a,long b)
    {
        long mod=1000000007;
        long pow=1;
        long x=a;
        while(b!=0)
        {
            if((b&1)!=0)pow=(pow*x)%mod;
            x=(x*x)%mod;
            b/=2;
        }
        return pow;
    }

    static long toggleBits(long x)//one's complement || Toggle bits
    {
        int n=(int)(Math.floor(Math.log(x)/Math.log(2)))+1;

        return ((1<<n)-1)^x;
    }

    static int countBits(long a)
    {
        return (int)(Math.log(a)/Math.log(2)+1);
    }

    static long fact(long N)
    {
        long n=2;
        if(N<=1)return 1;
        else
        {
            for(int i=3; i<=N; i++)n=(n*i)%mod;
        }
        return n;
    }

    static int kadane(int A[])
    {
        int lsum=A[0],gsum=A[0];
        for(int i=1; i<A.length; i++)
        {
            lsum=Math.max(lsum+A[i],A[i]);
            gsum=Math.max(gsum,lsum);
        }
        return gsum;
    }

    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

    static boolean isPrime(long N)
    {
        if (N<=1)  return false;
        if (N<=3)  return true;
        if (N%2 == 0 || N%3 == 0) return false;
        for (int i=5; i*i<=N; i=i+6)
            if (N%i == 0 || N%(i+2) == 0)
                return false;
        return true;
    }

    static int i()
    {
        return in.nextInt();
    }

    static long l()
    {
        return in.nextLong();
    }

    static int[] input(int N){
        int A[]=new int[N];
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] inputLong(int N)     {
        long A[]=new long[N];
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static long GCD(long a,long b)
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        br=new BufferedReader(new InputStreamReader(System.in));
    }

    String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try
            {
                st=new StringTokenizer(br.readLine());
            }
            catch(IOException e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str="";
        try
        {
            str=br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
import java.util.LinkedList;
import java.util.Queue;
public final class codeforces
{
    static StringBuilder ans=new StringBuilder();
    static FastReader in=new FastReader();
    static ArrayList<ArrayList<Integer>> g;
    static long mod=1000000007;
    static boolean set[];
    public static void main(String args[])throws IOException
    {
        String X=in.next();
        int N=X.length();
        long A[]=new long[N];
        int c=2;
        long pow=1;
        A[N-1]=1;
        for(int i=N-2; i>=0; i--)
        {
            pow=(pow*10)%mod;
            A[i]=((pow*c)%mod+A[i+1]%mod)%mod;
            c++;
            // System.out.println(A[i]);
        }
        long s=0;

        for(int i=N-1; i>=0; i--)
        {
            long r=((i*(i+1))/2)%mod;
            int ch=X.charAt(i)-'0';
            pow=pow(10,N-i-1);
            r=(r*pow*ch)%mod;
            s=(s%mod+r%mod)%mod;
            int l=i+1;
            if(l<N)
            {
                r=(A[l]*ch)%mod;
                s=(s%mod+r%mod)%mod;
            }

        }
        System.out.println(s);

    }

    static int sD(long n)
    {

        if (n % 2 == 0 )
            return 2;

        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0 )
                return i;
        }

        return (int)n;
    }

    static void setGraph(int N)
    {
        set=new boolean[N+1];
        g=new ArrayList<ArrayList<Integer>>();
        for(int i=0; i<=N; i++)
            g.add(new ArrayList<Integer>());
    }

    static void DFS(int N,int d)
    {
        set[N]=true;
        d++;
        for(int i=0; i<g.get(N).size(); i++)
        {
            int c=g.get(N).get(i);
            if(set[c]==false)
            {
                DFS(c,d);
            }
        }
    }

    static  long pow(long a,long b)
    {
        long mod=1000000007;
        long pow=1;
        long x=a;
        while(b!=0)
        {
            if((b&1)!=0)pow=(pow*x)%mod;
            x=(x*x)%mod;
            b/=2;
        }
        return pow;
    }

    static long toggleBits(long x)//one's complement || Toggle bits
    {
        int n=(int)(Math.floor(Math.log(x)/Math.log(2)))+1;

        return ((1<<n)-1)^x;
    }

    static int countBits(long a)
    {
        return (int)(Math.log(a)/Math.log(2)+1);
    }

    static long fact(long N)
    {
        long n=2;
        if(N<=1)return 1;
        else
        {
            for(int i=3; i<=N; i++)n=(n*i)%mod;
        }
        return n;
    }

    static int kadane(int A[])
    {
        int lsum=A[0],gsum=A[0];
        for(int i=1; i<A.length; i++)
        {
            lsum=Math.max(lsum+A[i],A[i]);
            gsum=Math.max(gsum,lsum);
        }
        return gsum;
    }

    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

    static boolean isPrime(long N)
    {
        if (N<=1)  return false;
        if (N<=3)  return true;
        if (N%2 == 0 || N%3 == 0) return false;
        for (int i=5; i*i<=N; i=i+6)
            if (N%i == 0 || N%(i+2) == 0)
                return false;
        return true;
    }

    static int i()
    {
        return in.nextInt();
    }

    static long l()
    {
        return in.nextLong();
    }

    static int[] input(int N){
        int A[]=new int[N];
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] inputLong(int N)     {
        long A[]=new long[N];
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static long GCD(long a,long b)
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        br=new BufferedReader(new InputStreamReader(System.in));
    }

    String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try
            {
                st=new StringTokenizer(br.readLine());
            }
            catch(IOException e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str="";
        try
        {
            str=br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
import java.util.LinkedList;
import java.util.Queue;
public final class codeforces
{
    static StringBuilder ans=new StringBuilder();
    static FastReader in=new FastReader();
    static ArrayList<ArrayList<Integer>> g;
    static long mod=1000000007;
    static boolean set[];
    public static void main(String args[])throws IOException
    {
        String X=in.next();
        int N=X.length();

        long pow=1;
        long s=0;
        long sum=0;
        pow=1;
        for(int i=N-1; i>=0; i--)
        {
            int c=X.charAt(i)-'0';
            long r=( ((long)i*(long)(i+1)/2)%mod   * pow%mod  +sum%mod)%mod;
            sum=(sum%mod + pow*(N-i)%mod)%mod;
            pow=(pow*10)%mod;
            s=(s%mod + c*r%mod)%mod;
        }
        System.out.println(s);

    }

    static int sD(long n)
    {

        if (n % 2 == 0 )
            return 2;

        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0 )
                return i;
        }

        return (int)n;
    }

    static void setGraph(int N)
    {
        set=new boolean[N+1];
        g=new ArrayList<ArrayList<Integer>>();
        for(int i=0; i<=N; i++)
            g.add(new ArrayList<Integer>());
    }

    static void DFS(int N,int d)
    {
        set[N]=true;
        d++;
        for(int i=0; i<g.get(N).size(); i++)
        {
            int c=g.get(N).get(i);
            if(set[c]==false)
            {
                DFS(c,d);
            }
        }
    }

    static  long pow(long a,long b)
    {
        long mod=1000000007;
        long pow=1;
        long x=a;
        while(b!=0)
        {
            if((b&1)!=0)pow=(pow*x)%mod;
            x=(x*x)%mod;
            b/=2;
        }
        return pow;
    }

    static long toggleBits(long x)//one's complement || Toggle bits
    {
        int n=(int)(Math.floor(Math.log(x)/Math.log(2)))+1;

        return ((1<<n)-1)^x;
    }

    static int countBits(long a)
    {
        return (int)(Math.log(a)/Math.log(2)+1);
    }

    static long fact(long N)
    {
        long n=2;
        if(N<=1)return 1;
        else
        {
            for(int i=3; i<=N; i++)n=(n*i)%mod;
        }
        return n;
    }

    static int kadane(int A[])
    {
        int lsum=A[0],gsum=A[0];
        for(int i=1; i<A.length; i++)
        {
            lsum=Math.max(lsum+A[i],A[i]);
            gsum=Math.max(gsum,lsum);
        }
        return gsum;
    }

    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

    static boolean isPrime(long N)
    {
        if (N<=1)  return false;
        if (N<=3)  return true;
        if (N%2 == 0 || N%3 == 0) return false;
        for (int i=5; i*i<=N; i=i+6)
            if (N%i == 0 || N%(i+2) == 0)
                return false;
        return true;
    }

    static int i()
    {
        return in.nextInt();
    }

    static long l()
    {
        return in.nextLong();
    }

    static int[] input(int N){
        int A[]=new int[N];
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] inputLong(int N)     {
        long A[]=new long[N];
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static long GCD(long a,long b)
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        br=new BufferedReader(new InputStreamReader(System.in));
    }

    String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try
            {
                st=new StringTokenizer(br.readLine());
            }
            catch(IOException e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str="";
        try
        {
            str=br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
import java.util.LinkedList;
import java.util.Queue;
public final class codeforces
{
    static StringBuilder ans=new StringBuilder();
    static FastReader in=new FastReader();
    static ArrayList<ArrayList<Integer>> g;
    static long mod=1000000007;
    static boolean set[];
    public static void main(String args[])throws IOException
    {
        String X=in.next();
        int N=X.length();

        long pow=1;
        long s=0;
        long sum=0;
        pow=1;
        for(long i=N-1; i>=0; i--)
        {
            int c=X.charAt((int)i)-'0';
            long r=( (i*(i+1)/2)%mod   * pow%mod  +sum%mod)%mod;
            sum=(sum%mod + pow*(N-i)%mod)%mod;
            pow=(pow*10)%mod;
            s=(s%mod + c*r%mod)%mod;
        }
        System.out.println(s);

    }

    static int sD(long n)
    {

        if (n % 2 == 0 )
            return 2;

        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0 )
                return i;
        }

        return (int)n;
    }

    static void setGraph(int N)
    {
        set=new boolean[N+1];
        g=new ArrayList<ArrayList<Integer>>();
        for(int i=0; i<=N; i++)
            g.add(new ArrayList<Integer>());
    }

    static void DFS(int N,int d)
    {
        set[N]=true;
        d++;
        for(int i=0; i<g.get(N).size(); i++)
        {
            int c=g.get(N).get(i);
            if(set[c]==false)
            {
                DFS(c,d);
            }
        }
    }

    static  long pow(long a,long b)
    {
        long mod=1000000007;
        long pow=1;
        long x=a;
        while(b!=0)
        {
            if((b&1)!=0)pow=(pow*x)%mod;
            x=(x*x)%mod;
            b/=2;
        }
        return pow;
    }

    static long toggleBits(long x)//one's complement || Toggle bits
    {
        int n=(int)(Math.floor(Math.log(x)/Math.log(2)))+1;

        return ((1<<n)-1)^x;
    }

    static int countBits(long a)
    {
        return (int)(Math.log(a)/Math.log(2)+1);
    }

    static long fact(long N)
    {
        long n=2;
        if(N<=1)return 1;
        else
        {
            for(int i=3; i<=N; i++)n=(n*i)%mod;
        }
        return n;
    }

    static int kadane(int A[])
    {
        int lsum=A[0],gsum=A[0];
        for(int i=1; i<A.length; i++)
        {
            lsum=Math.max(lsum+A[i],A[i]);
            gsum=Math.max(gsum,lsum);
        }
        return gsum;
    }

    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

    static boolean isPrime(long N)
    {
        if (N<=1)  return false;
        if (N<=3)  return true;
        if (N%2 == 0 || N%3 == 0) return false;
        for (int i=5; i*i<=N; i=i+6)
            if (N%i == 0 || N%(i+2) == 0)
                return false;
        return true;
    }

    static int i()
    {
        return in.nextInt();
    }

    static long l()
    {
        return in.nextLong();
    }

    static int[] input(int N){
        int A[]=new int[N];
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] inputLong(int N)     {
        long A[]=new long[N];
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static long GCD(long a,long b)
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        br=new BufferedReader(new InputStreamReader(System.in));
    }

    String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try
            {
                st=new StringTokenizer(br.readLine());
            }
            catch(IOException e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str="";
        try
        {
            str=br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
import java.util.LinkedList;
import java.util.Queue;
public final class codeforces
{
    static StringBuilder ans=new StringBuilder();
    static FastReader in=new FastReader();
    static ArrayList<ArrayList<Integer>> g;
    static long mod=1000000007;
    static boolean set[];
    public static void main(String args[])throws IOException
    {
        String X=in.next();
        int N=X.length();
        long A[]=new long[N];
        int c=2;
        long pow=1;
        A[N-1]=1;
        for(int i=N-2; i>=0; i--)
        {
            pow=(pow*10)%mod;
            A[i]=((pow*c)+A[i+1])%mod;
            c++;
            // System.out.println(A[i]);
        }
        long s=0;

        for(int i=N-1; i>=0; i--)
        {
            long r=((i*(i+1))/2)%mod;
            int ch=X.charAt(i)-'0';
            pow=pow(10,N-i-1)%mod;
            r=(r*pow*ch)%mod;
            s=(s+r)%mod;
            int l=i+1;
            if(l<N)
            {
                r=(A[l]*ch)%mod;
                s=(s+r)%mod;
            }

        }
        System.out.println(s);

    }

    static int sD(long n)
    {

        if (n % 2 == 0 )
            return 2;

        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0 )
                return i;
        }

        return (int)n;
    }

    static void setGraph(int N)
    {
        set=new boolean[N+1];
        g=new ArrayList<ArrayList<Integer>>();
        for(int i=0; i<=N; i++)
            g.add(new ArrayList<Integer>());
    }

    static void DFS(int N,int d)
    {
        set[N]=true;
        d++;
        for(int i=0; i<g.get(N).size(); i++)
        {
            int c=g.get(N).get(i);
            if(set[c]==false)
            {
                DFS(c,d);
            }
        }
    }

    static  long pow(long a,long b)
    {
        long mod=1000000007;
        long pow=1;
        long x=a;
        while(b!=0)
        {
            if((b&1)!=0)pow=(pow*x)%mod;
            x=(x*x)%mod;
            b/=2;
        }
        return pow;
    }

    static long toggleBits(long x)//one's complement || Toggle bits
    {
        int n=(int)(Math.floor(Math.log(x)/Math.log(2)))+1;

        return ((1<<n)-1)^x;
    }

    static int countBits(long a)
    {
        return (int)(Math.log(a)/Math.log(2)+1);
    }

    static long fact(long N)
    {
        long n=2;
        if(N<=1)return 1;
        else
        {
            for(int i=3; i<=N; i++)n=(n*i)%mod;
        }
        return n;
    }

    static int kadane(int A[])
    {
        int lsum=A[0],gsum=A[0];
        for(int i=1; i<A.length; i++)
        {
            lsum=Math.max(lsum+A[i],A[i]);
            gsum=Math.max(gsum,lsum);
        }
        return gsum;
    }

    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

    static boolean isPrime(long N)
    {
        if (N<=1)  return false;
        if (N<=3)  return true;
        if (N%2 == 0 || N%3 == 0) return false;
        for (int i=5; i*i<=N; i=i+6)
            if (N%i == 0 || N%(i+2) == 0)
                return false;
        return true;
    }

    static int i()
    {
        return in.nextInt();
    }

    static long l()
    {
        return in.nextLong();
    }

    static int[] input(int N){
        int A[]=new int[N];
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] inputLong(int N)     {
        long A[]=new long[N];
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static long GCD(long a,long b)
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        br=new BufferedReader(new InputStreamReader(System.in));
    }

    String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try
            {
                st=new StringTokenizer(br.readLine());
            }
            catch(IOException e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str="";
        try
        {
            str=br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
import java.util.LinkedList;
import java.util.Queue;
public final class codeforces
{
    static StringBuilder ans=new StringBuilder();
    static FastReader in=new FastReader();
    static ArrayList<ArrayList<Integer>> g;
    static long mod=1000000007;
    static boolean set[];
    public static void main(String args[])throws IOException
    {
        String X=in.next();
        int N=X.length();

        long pow=1;
        long s=0;
        long sum=0;
        pow=1;
        for(long i=N-1; i>=0; i--)
        {
            int c=X.charAt(i)-'0';
            long r=( (i*(i+1)/2)%mod   * pow%mod  +sum%mod)%mod;
            sum=(sum%mod + pow*(N-i)%mod)%mod;
            pow=(pow*10)%mod;
            s=(s%mod + c*r%mod)%mod;
        }
        System.out.println(s);

    }

    static int sD(long n)
    {

        if (n % 2 == 0 )
            return 2;

        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0 )
                return i;
        }

        return (int)n;
    }

    static void setGraph(int N)
    {
        set=new boolean[N+1];
        g=new ArrayList<ArrayList<Integer>>();
        for(int i=0; i<=N; i++)
            g.add(new ArrayList<Integer>());
    }

    static void DFS(int N,int d)
    {
        set[N]=true;
        d++;
        for(int i=0; i<g.get(N).size(); i++)
        {
            int c=g.get(N).get(i);
            if(set[c]==false)
            {
                DFS(c,d);
            }
        }
    }

    static  long pow(long a,long b)
    {
        long mod=1000000007;
        long pow=1;
        long x=a;
        while(b!=0)
        {
            if((b&1)!=0)pow=(pow*x)%mod;
            x=(x*x)%mod;
            b/=2;
        }
        return pow;
    }

    static long toggleBits(long x)//one's complement || Toggle bits
    {
        int n=(int)(Math.floor(Math.log(x)/Math.log(2)))+1;

        return ((1<<n)-1)^x;
    }

    static int countBits(long a)
    {
        return (int)(Math.log(a)/Math.log(2)+1);
    }

    static long fact(long N)
    {
        long n=2;
        if(N<=1)return 1;
        else
        {
            for(int i=3; i<=N; i++)n=(n*i)%mod;
        }
        return n;
    }

    static int kadane(int A[])
    {
        int lsum=A[0],gsum=A[0];
        for(int i=1; i<A.length; i++)
        {
            lsum=Math.max(lsum+A[i],A[i]);
            gsum=Math.max(gsum,lsum);
        }
        return gsum;
    }

    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

    static boolean isPrime(long N)
    {
        if (N<=1)  return false;
        if (N<=3)  return true;
        if (N%2 == 0 || N%3 == 0) return false;
        for (int i=5; i*i<=N; i=i+6)
            if (N%i == 0 || N%(i+2) == 0)
                return false;
        return true;
    }

    static int i()
    {
        return in.nextInt();
    }

    static long l()
    {
        return in.nextLong();
    }

    static int[] input(int N){
        int A[]=new int[N];
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] inputLong(int N)     {
        long A[]=new long[N];
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static long GCD(long a,long b)
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        br=new BufferedReader(new InputStreamReader(System.in));
    }

    String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try
            {
                st=new StringTokenizer(br.readLine());
            }
            catch(IOException e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str="";
        try
        {
            str=br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }

}


import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
{
	PrintWriter out = new PrintWriter(System.out);
	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer tok = new StringTokenizer("");
    String next() throws IOException {
        if (!tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine()); }
        return tok.nextToken();
    }
    int ni() throws IOException { return Integer.parseInt(next()); }
    long nl() throws IOException { return Long.parseLong(next()); }

    long mod=1000000007;

    void solve() throws IOException {
        String s=next();
        int n=s.length();
        int[]A=new int[n];
        for (int i=0;i<n;i++) A[i]=(int)(s.charAt(i)-'0');

        long[]B=new long[n];
        long[]C=new long[n];
        //B[0]=1;
        //C[0]=1;
        long mult=1;
        for (int i=1;i<n;i++) {
            B[i]=(B[i-1]+mult*i)%mod;
            mult=(mult*10)%mod;
            C[i]=(C[i-1]+i)%mod;
        }
        long ans=0;
        for (int p=0,q=n-1;p<n;p++,q--) {
            ans=(ans+B[q]*A[p])%mod;
            //out.println(ans);
            //out.println(q+" "+mp(10,q));
            ans=(ans+C[p]*(mp(10,q)*A[p])%mod)%mod;
            //out.println(ans);
        }
        out.println(ans);
        out.flush();
    }

    int gcd(int a,int b) { return(b==0?a:gcd(b,a%b)); }
    long gcd(long a,long b) { return(b==0?a:gcd(b,a%b)); }
    long mp(long a,long p) { long r=1; while(p>0) { if ((p&1)==1) r=(r*a)%mod; p>>=1; a=(a*a)%mod; } return r; }

    public static void main(String[] args) throws IOException {
        new Main().solve();
    }
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);

		long m=1000000007;

		long inv=power(9,m-2,m);

		String str=s.next();

		int n=str.length();

		long ans=0;

		for(int i=0;i<n;i++)
		{
			long val=Long.valueOf(str.charAt(i)+"");

			long cp=i;

			long pre=((((cp*(cp+1))/2)%m*val%m)%m*power(10,n-1-i,m)%m)%m;

			long c=power(10,n-1-i,m);

			long term1=((n-1-i)%m*c%m)%m;
			long term2=((c%m-1%m+m)%m*inv%m)%m;

			long suf=(val%m*((term1%m-term2%m+m)%m*inv%m)%m)%m;

			ans=(ans%m+pre%m)%m;
			ans=(ans%m+suf%m)%m;

		}

		System.out.println(ans);

	}

	public static long power(long a,long b,long m)
	{
		long res=1;

		while(b>0)
		{
			if(b%2!=0)
			{
				res=(res%m*a%m)%m;
			}

			b=b/2;
			a=(a%m*a%m)%m;
		}

		return res;
	}

}


import java.util.*;
import java.io.*;

public class CFC {
  BufferedReader br;
  PrintWriter out;
  StringTokenizer st;
  boolean eof;
  private static final long MOD = 1000L * 1000L * 1000L + 7;
  private static final int[] dx = {0, -1, 0, 1};
  private static final int[] dy = {1, 0, -1, 0};
  private static final String yes = "Yes";
  private static final String no = "No";

  void solve() {
//    int T = nextInt();
    int T = 1;
    for (int i = 0; i < T; i++) {
      helper();
    }
  }

  void helper() {
    char[] arr = nextString().toCharArray();
    int LIMIT = 100 * 1000 + 10;
    long[] pow10 = new long[LIMIT];
    pow10[0] = 1;
    for (int i = 1; i < LIMIT; i++) {
      pow10[i] = pow10[i - 1] * 10 % MOD;
    }

    long[] prefSum = Arrays.copyOf(pow10, pow10.length);
    for (int i = 0; i < LIMIT; i++) {
      prefSum[i] = prefSum[i] * (i + 1) % MOD;
    }

    for (int i = 1; i < LIMIT; i++) {
      prefSum[i] += prefSum[i - 1];
      prefSum[i] %= MOD;
    }

    long res = 0;
    for (int i = 0; i < arr.length; i++) {
      if (arr[i] == '0') {
        continue;
      }

      int val = arr[i] - '0';
      int right = arr.length - 1 - (i + 1) + 1;
      long leftSum = 1L * i * (i + 1) / 2;
      leftSum = leftSum * val % MOD;
      leftSum = leftSum * pow10[right] % MOD;
      long rightSum = right > 0 ? prefSum[right - 1] * val % MOD : 0;
      res += (leftSum + rightSum) % MOD;
      res %= MOD;
    }
    outln(res);
  }

  void shuffle(long[] a) {
    int n = a.length;
    for(int i = 0; i < n; i++) {
      int r = i + (int) (Math.random() * (n - i));
      long tmp = a[i];
      a[i] = a[r];
      a[r] = tmp;
    }
  }
  long gcd(long a, long b) {
    while(a != 0 && b != 0) {
      long c = b;
      b = a % b;
      a = c;
    }
    return a + b;
  }
  private void outln(Object o) {
    out.println(o);
  }
  private void out(Object o) {
    out.print(o);
  }
  private void formatPrint(double val) {
    outln(String.format("%.9f%n", val));
  }
  public CFC() {
    br = new BufferedReader(new InputStreamReader(System.in));
    out = new PrintWriter(System.out);
    solve();
    out.close();
  }
  public static void main(String[] args) {
    new CFC();
  }

  public long[] nextLongArr(int n) {
    long[] res = new long[n];
    for(int i = 0; i < n; i++)
      res[i] = nextLong();
    return res;
  }
  public int[] nextIntArr(int n) {
    int[] res = new int[n];
    for(int i = 0; i < n; i++)
      res[i] = nextInt();
    return res;
  }
  public String nextToken() {
    while (st == null || !st.hasMoreTokens()) {
      try {
        st = new StringTokenizer(br.readLine());
      } catch (Exception e) {
        eof = true;
        return null;
      }
    }
    return st.nextToken();
  }
  public String nextString() {
    try {
      return br.readLine();
    } catch (IOException e) {
      eof = true;
      return null;
    }
  }
  public int nextInt() {
    return Integer.parseInt(nextToken());
  }
  public long nextLong() {
    return Long.parseLong(nextToken());
  }
  public double nextDouble() {
    return Double.parseDouble(nextToken());
  }
}


import java.io.*;
import java.util.*;
public class d3prac implements Runnable
{
	private boolean console=false;

	public void solve()
	{
		int i; long mod=(int)1e9+7;
		char a[]=in.ns().toCharArray(); int n=a.length;
		long ans=0; long pow[]=new long[100005]; long num=1;
		for(i=0;i<pow.length;i++)
		{
			pow[i]= num%mod; num*=10; num%=mod;
		}
		if(n==1)
		{
			out.println(0); return;
		}
		num=a[0]-'0'; ans=(pow[n-2]*(n-1))%mod;
		ans=(ans*num)%mod;
		for(i=1;i<n-1;i++)
		{
			long v=a[i]-'0';	num+=v;
			long cur=(num*(n-i-1))%mod; 			cur=(cur*pow[n-i-2])%mod;

			ans=(ans+cur)%mod;
			cur=(long)i*(i+1)/2; cur%=mod;

			cur=(cur*pow[n-i-1])%mod; cur=(cur*v)%mod;
			ans=(ans+cur)%mod;
		}
		long cur=(n*(n-1)/2)%mod; cur=cur*(a[n-1]-'0'); cur%=mod;
		ans+=cur; ans=ans%mod;
		out.println(ans);
	}
	@Override
	public void run() {
		try {  init();  }
		catch (FileNotFoundException e) {  e.printStackTrace();   }

		int t= 1;

		while (t-->0) {
			solve();
			out.flush(); }
	}
	private FastInput in;    private PrintWriter out;
	public static void main(String[] args) throws Exception {	 new d3prac().run();	 }

	private void init() throws FileNotFoundException {
		InputStream inputStream = System.in; 	 OutputStream outputStream = System.out;
		try {  if (!console && System.getProperty("user.name").equals("sachan")) {
			outputStream = new FileOutputStream("/home/sachan/Desktop/output.txt");
			inputStream = new FileInputStream("/home/sachan/Desktop/input.txt");   	}
		}	catch (Exception ignored) {	}
		out = new PrintWriter(outputStream); 	 in = new FastInput(inputStream);
	}
	static class FastInput { InputStream obj;
	public FastInput(InputStream obj) {	this.obj = obj;	}
	byte inbuffer[] = new byte[1024];  int lenbuffer = 0, ptrbuffer = 0;
	int readByte() { if (lenbuffer == -1) throw new InputMismatchException();
	if (ptrbuffer >= lenbuffer) { ptrbuffer = 0;
	try { lenbuffer = obj.read(inbuffer);  }
	catch (IOException e) { throw new InputMismatchException(); } }
	if (lenbuffer <= 0) return -1;return inbuffer[ptrbuffer++]; }

	String ns() { int b = skip();StringBuilder sb = new StringBuilder();
	while (!(isSpaceChar(b)))	  { sb.appendCodePoint(b);b = readByte(); }return sb.toString();}

	int ni() { int num = 0, b;boolean minus = false;
	while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	if (b == '-') { minus = true;b = readByte(); }
	while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else {
		return minus ? -num : num; }b = readByte(); }}

	long nl() { long num = 0;int b;boolean minus = false;
	while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	if (b == '-') { minus = true;b = readByte(); }
	while (true) { if (b >= '0' && b <= '9') { num = num * 10L + (b - '0'); } else {
		return minus ? -num : num; }b = readByte(); } }

	boolean isSpaceChar(int c) { return (!(c >= 33 && c <= 126)); }
	int skip() { int b;while ((b = readByte()) != -1 && isSpaceChar(b)) ;return b; }
	float nf() {return Float.parseFloat(ns());}
	double nd() {return Double.parseDouble(ns());}
	char nc() {return (char) skip();}
	}
}


import java.io.*;
import java.util.*;
public class d3prac implements Runnable
{
	private boolean console=false;

	public void solve()
	{
		int i; long mod=(int)1e9+7;
		char a[]=in.ns().toCharArray(); int n=a.length;
		long ans=0; long pow[]=new long[100005]; long num=1;
		for(i=0;i<pow.length;i++)
		{
			pow[i]= num%mod; num*=10; num%=mod;
		}
		if(n==1)
		{
			out.println(0); return;
		}
		num=a[0]-'0'; ans=(pow[n-2]*(n-1))%mod;
		ans=(ans*num)%mod;
		for(i=1;i<n-1;i++)
		{
			long v=a[i]-'0';	num+=v;
			long cur=(num*(n-i-1))%mod;
			cur=(cur*pow[n-i-2])%mod;

			ans=(ans+cur)%mod;
			cur=(long)i*(i+1)/2; cur%=mod;

			cur=(cur*pow[n-i-1])%mod;
			cur=(cur*v)%mod;
			ans=(ans+cur)%mod;
		}
		long cur=((long)n*(n-1)/2)%mod; cur=cur*(a[n-1]-'0'); cur%=mod;
		ans+=cur; ans=ans%mod;

		out.println(ans);
	}
	@Override
	public void run() {
		try {  init();  }
		catch (FileNotFoundException e) {  e.printStackTrace();   }

		int t= 1;

		while (t-->0) {
			solve();
			out.flush(); }
	}
	private FastInput in;    private PrintWriter out;
	public static void main(String[] args) throws Exception {	 new d3prac().run();	 }

	private void init() throws FileNotFoundException {
		InputStream inputStream = System.in; 	 OutputStream outputStream = System.out;
		try {  if (!console && System.getProperty("user.name").equals("sachan")) {
			outputStream = new FileOutputStream("/home/sachan/Desktop/output.txt");
			inputStream = new FileInputStream("/home/sachan/Desktop/input.txt");   	}
		}	catch (Exception ignored) {	}
		out = new PrintWriter(outputStream); 	 in = new FastInput(inputStream);
	}
	static class FastInput { InputStream obj;
	public FastInput(InputStream obj) {	this.obj = obj;	}
	byte inbuffer[] = new byte[1024];  int lenbuffer = 0, ptrbuffer = 0;
	int readByte() { if (lenbuffer == -1) throw new InputMismatchException();
	if (ptrbuffer >= lenbuffer) { ptrbuffer = 0;
	try { lenbuffer = obj.read(inbuffer);  }
	catch (IOException e) { throw new InputMismatchException(); } }
	if (lenbuffer <= 0) return -1;return inbuffer[ptrbuffer++]; }

	String ns() { int b = skip();StringBuilder sb = new StringBuilder();
	while (!(isSpaceChar(b)))	  { sb.appendCodePoint(b);b = readByte(); }return sb.toString();}

	int ni() { int num = 0, b;boolean minus = false;
	while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	if (b == '-') { minus = true;b = readByte(); }
	while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else {
		return minus ? -num : num; }b = readByte(); }}

	long nl() { long num = 0;int b;boolean minus = false;
	while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	if (b == '-') { minus = true;b = readByte(); }
	while (true) { if (b >= '0' && b <= '9') { num = num * 10L + (b - '0'); } else {
		return minus ? -num : num; }b = readByte(); } }

	boolean isSpaceChar(int c) { return (!(c >= 33 && c <= 126)); }
	int skip() { int b;while ((b = readByte()) != -1 && isSpaceChar(b)) ;return b; }
	float nf() {return Float.parseFloat(ns());}
	double nd() {return Double.parseDouble(ns());}
	char nc() {return (char) skip();}
	}
}


import java.io.*;
import java.util.*;
public class d3prac implements Runnable
{
	private boolean console=false;

	public void solve()
	{
		int i; long mod=(int)1e9+7;
		char a[]=in.ns().toCharArray(); int n=a.length;
		long ans=0; long pow[]=new long[100005]; long num=1;
		for(i=0;i<pow.length;i++)
		{
			pow[i]= num%mod; num*=10; num%=mod;
		}
		if(n==1)
		{
			out.println(0); return;
		}
		num=a[0]-'0'; ans=(pow[n-2]*(n-1))%mod;
		ans=(ans*num)%mod;
		for(i=1;i<n-1;i++)
		{
			long v=a[i]-'0';	num+=v;
			long cur=(num*(n-i-1))%mod;
			cur=(cur*pow[n-i-2])%mod;

			ans=(ans+cur)%mod;
			cur=(long)i*(i+1)/2; cur%=mod;

			cur=(cur*pow[n-i-1])%mod;
			cur=(cur*v)%mod;
			ans=(ans+cur)%mod;
		}
		long cur=(long)(n*(n-1)/2)%mod; cur=cur*(a[n-1]-'0'); cur%=mod;
		ans+=cur; ans=ans%mod;

		out.println(ans);
	}
	@Override
	public void run() {
		try {  init();  }
		catch (FileNotFoundException e) {  e.printStackTrace();   }

		int t= 1;

		while (t-->0) {
			solve();
			out.flush(); }
	}
	private FastInput in;    private PrintWriter out;
	public static void main(String[] args) throws Exception {	 new d3prac().run();	 }

	private void init() throws FileNotFoundException {
		InputStream inputStream = System.in; 	 OutputStream outputStream = System.out;
		try {  if (!console && System.getProperty("user.name").equals("sachan")) {
			outputStream = new FileOutputStream("/home/sachan/Desktop/output.txt");
			inputStream = new FileInputStream("/home/sachan/Desktop/input.txt");   	}
		}	catch (Exception ignored) {	}
		out = new PrintWriter(outputStream); 	 in = new FastInput(inputStream);
	}
	static class FastInput { InputStream obj;
	public FastInput(InputStream obj) {	this.obj = obj;	}
	byte inbuffer[] = new byte[1024];  int lenbuffer = 0, ptrbuffer = 0;
	int readByte() { if (lenbuffer == -1) throw new InputMismatchException();
	if (ptrbuffer >= lenbuffer) { ptrbuffer = 0;
	try { lenbuffer = obj.read(inbuffer);  }
	catch (IOException e) { throw new InputMismatchException(); } }
	if (lenbuffer <= 0) return -1;return inbuffer[ptrbuffer++]; }

	String ns() { int b = skip();StringBuilder sb = new StringBuilder();
	while (!(isSpaceChar(b)))	  { sb.appendCodePoint(b);b = readByte(); }return sb.toString();}

	int ni() { int num = 0, b;boolean minus = false;
	while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	if (b == '-') { minus = true;b = readByte(); }
	while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else {
		return minus ? -num : num; }b = readByte(); }}

	long nl() { long num = 0;int b;boolean minus = false;
	while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	if (b == '-') { minus = true;b = readByte(); }
	while (true) { if (b >= '0' && b <= '9') { num = num * 10L + (b - '0'); } else {
		return minus ? -num : num; }b = readByte(); } }

	boolean isSpaceChar(int c) { return (!(c >= 33 && c <= 126)); }
	int skip() { int b;while ((b = readByte()) != -1 && isSpaceChar(b)) ;return b; }
	float nf() {return Float.parseFloat(ns());}
	double nd() {return Double.parseDouble(ns());}
	char nc() {return (char) skip();}
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/*
@author kalZor
 */
public class TaskC {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(1, in, out);
        out.close();
    }

    static class Solver {
        public static final int MOD  = (int)(1e9+7);
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            String s = in.next();
            int n = s.length();
            int[] values = new int[n];
            for(int i=0;i<n;i++){
                values[i] = (s.charAt(n-1-i) - '0');
            }
            long[] powers = new long[n];
            long pow = 1;
            for(int i=0;i<n;i++){
                powers[i] = pow;
                pow = (pow*10)%MOD;
            }
            long tenValues = 0 ;
            long fans = 0;
            long multiple = 1;
            long nAfterCurr = n-1;
            for(int i=0;i<n;i++){
                long leftSide = ((((nAfterCurr*(nAfterCurr+1))/2)%MOD*(powers[i]))%MOD*values[i])%MOD;
                long rightSide = (values[i]*tenValues)%MOD;
                fans = (fans+(leftSide+rightSide)%MOD)%MOD;
                tenValues = (tenValues+(powers[i]*multiple)%MOD)%MOD;
                multiple = (multiple+1)%MOD;
                nAfterCurr--;
//                out.println(leftSide+" "+rightSide);

            }
            out.println(fans);
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader(InputStream stream){
            br = new BufferedReader(new
                InputStreamReader(stream));
        }

        public String next(){
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt(){
            return Integer.parseInt(next());
        }

        public long nextLong(){
            return Long.parseLong(next());
        }

        public double nextDouble(){
            return Double.parseDouble(next());
        }

        public String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            }
            catch (IOException e){
                e.printStackTrace();
            }
            return str;
        }

        public int[] nextArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
                return a;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;

public class C {

	public static final long mod=(int)1e9+7;

	public static void main(String[] args) {
		FastScanner fs=new FastScanner();
		char[] line=fs.next().toCharArray();
		int n=line.length;
		int[] values=new int[n];
		for (int i=0; i<n; i++) values[i]=line[n-1-i]-'0';

		long total=0;
		long tenValues=0;
		long tenPow=1;
		long multiple=1;
		int nBiggerNumbers=n-1;
		for (int i:values) {
			//range is of bigger numbers
			total=add(total, mul(i, mul(nC2(nBiggerNumbers), tenPow)));

			//delete smaller numbers
			total=add(total, mul(i, tenValues));

			tenValues=add(tenValues, mul(tenPow, multiple));
			multiple=add(multiple, 1);
			tenPow=mul(tenPow, 10);
			nBiggerNumbers--;
		}
		System.out.println(total);
	}

	static long nC2(long n) {
		return add(n*(n+1)/2, 0);
	}

	static long add(long a, long b) {
		return ((a+b)%mod+mod)%mod;
	}

	static long mul(long a, long b) {
		return ((a*b)%mod+mod)%mod;
	}

	static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

}