#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll  long long

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;

    int n = s.size();
    vector<ll> a(n);
    for (int i = 0; i < n; ++i) {
        a[i] = s[i] - '0';
    }

    ll ans = 0;
    ll d = 1;
    ll su = 0;
    const int mod = (int)1e+9 + 7;
    for (int i = n - 1; i >= 0; --i)
    {
        ll k = (i * (i + 1) / 2 % mod * d % mod + su) % mod;
        ans = (ans + a[i] * k % mod) % mod;
        su = (su + d * (n - i) % mod) % mod;
        d = d * 10 % mod;
    }
    cout << ans << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll  long long

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;

    int n = (int)s.size();
    vector<ll> a(n);
    for (int i = 0; i < n; ++i) {
        a[i] = s[i] - '0';
    }

    ll ans = 0;
    ll d = 1;
    ll su = 0;
    const int mod = (int)1e+9 + 7;
    for (ll i = n - 1; i >= 0; --i)
    {
        ll k = (i * (i + 1) / 2 % mod * d % mod + su) % mod;
        ans = (ans + a[i] * k % mod) % mod;
        su = (su + d * (n - i) % mod) % mod;
        d = d * 10 % mod;
    }
    cout << ans << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

#define sll  long long

ll mod = (ll)(1e9 + 7);
sll c(sll a, sll d, sll b, sll r, sll n)
{
    sll ans = 0;
    ans += a;
    ans += (sll)(((d * r * (1 - (sll)pow(r, n-1)))/(1-r))%mod);
    ans -= (sll)((a + (n-1)*d)*(sll)pow(r, n)%mod);
    return (ans*b)/(1-r);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll f = 1;
    ll d = 1;
    ll s = 0;
    for (int i = len-1; i >=0; i--)
    {
        ll kf = (i*(i+1)/2%mod);
        ll km = d;
        ll k = (kf * km)%mod;
        ans += (a[i] * ((k+s)%mod));
        s += f * d;
        s %= mod;
        f += 1;
        d *= 10;
        d %= mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

#define sll  long long

ll mod = (ll)(1e9 + 7);
sll c(sll a, sll d, sll b, sll r, sll n)
{
    sll ans = 0;
    ans += a;
    ans += (sll)(((d * r * (1 - (sll)pow(r, n-1)))/(1-r))%mod);
    ans -= (sll)((a + (n-1)*d)*(sll)pow(r, n)%mod);
    return (ans*b)/(1-r);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll d = 1;
    ll s = 0;
    for (int i = len-1; i >=0; i--)
    {
        ll kf = (i*(i+1)/2%mod);
        ll km = d;
        ll k = (kf * km)%mod;
        ans += (a[i] * ((k+s)%mod))%mod;
        s += ((len-i) * d)%mod;
        d *= 10%mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

#define sll  long long

ll mod = (ll)(1e9 + 7);
sll c(sll a, sll d, sll b, sll r, sll n)
{
    sll ans = 0;
    ans += a;
    ans += (sll)(((d * r * (1 - (sll)pow(r, n-1)))/(1-r))%mod);
    ans -= (sll)((a + (n-1)*d)*(sll)pow(r, n)%mod);
    return (ans*b)/(1-r);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll f = 1;
    ll d = 1;
    ll s = 0;
    for (int i = len-1; i >=0; i--)
    {
        ll kf = (i*(i+1)/2%mod);
        ll km = ((ll)pow(10, len-i-1)%mod);
        ll k = (kf * km)%mod;
        ans += (a[i] * ((k+s)%mod));
        s += f * d;
        s %= mod;
        f += 1;
        d *= 10;
        d %= mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll long long
#define sll long long

ll mod = (ll)(1e9 + 7);

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll f = 1;
    ll d = 1;
    ll s = 0;
    for (sll i = len - 1; i >= 0; i--)
    {
        ll k = ((ll)i*1ull * (i + 1) / 2 % mod) * ((ll)pow(10, len - i - 1) % mod);
        ans += (a[i] * ((k + s) % mod));
        s += (f * d) % mod;
        s %= mod;
        f += 1 % mod;
        d *= 10 % mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

#define sll  long long

ll mod = (ll)(1e9 + 7);

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll f = 1;
    ll d = 1;
    ll s = 0;
    for (int i = len-1; i >=0; i--)
    {
        ll k = (i*(i+1)/2%mod) * ((ll)pow(10, len-i-1)%mod);
        ans += (a[i] * ((k+s)%mod));
        s += (f * d)%mod;
        s %= mod;
        f += 1;
        d *= 10;
        d %= mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll  long long

ll MOD = (ll)(1e9 + 7);

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll d = 1;
    ll s = 0;
    for (int i = len - 1; i >= 0; --i)
    {
        ll k = (i * (i + 1) / 2 % MOD * d % MOD + s) % MOD;
        s = (s + d * (len - i) % MOD) % MOD;
        d = d * 10 % MOD;
        ans = (ans + a[i] * k % MOD) % MOD;
    }
    cout << ans  << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

#define sll long long

ll mod = (ll)(1e9 + 7);
sll c(sll a, sll d, sll b, sll r, sll n)
{
    sll ans = 0;
    ans += a;
    ans += (sll)(((d * r * (1 - (sll)pow(r, n - 1))) / (1 - r)) % mod);
    ans -= (sll)((a + (n - 1) * d) * (sll)pow(r, n) % mod);
    return (ans * b) / (1 - r);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll d = 1;
    ll s = 0;
    for (int i = len - 1; i >= 0; i--)
    {
        ll kf = (i * (i + 1) / 2 % mod * d % mod + s) % mod;
        ans += (a[i] * (kf % mod)) % mod;
        s = (s + d * (len - i) % mod) % mod;
        d = d * 10 % mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll  long long

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll d = 1;
    ll s = 0;
    const int mod = (int)1e+9 + 7;
    for (int i = len - 1; i >= 0; --i)
    {
        ll k = (i * (i + 1) / 2 % mod * d % mod + s) % mod;
        ans = (ans + a[i] * k % mod) % mod;
        s = (s + d * (len - i) % mod) % mod;
        d = d * 10 % mod;
    }
    cout << ans << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <chrono>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll mod = 1e9+7;
    string n;
    cin >> n;
    int len = (int)n.size();
    ll ans = 0;
    for(int i = 0; i < len; i++){
        for(int j = i; j < len; j++){
            ll val = 0;
            for(int k = 0; k < len; k++){
                if(k == i) k = j+1;
                if(k<len)val = val*10 + (n[k]-'0');
            }
            ans += val%mod;
        }
    }
    cout << ans%mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll  long long
#define sll  long long

ll mod = (ll)(1e9 + 7);

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll f = 1;
    ll d = 1;
    ll s = 0;
    for (sll i = len - 1; i >= 0; i--)
    {
        ll k = ((i * (i + 1) / 2 * (1ull) * d) % mod);
        ans += (a[i] * ((k + s) % mod));
        s += (f * d) % mod;
        s %= mod;
        f += 1 % mod;
        d *= 10 % mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

#define sll  long long

ll mod = (ll)(1e9 + 7);
sll c(sll a, sll d, sll b, sll r, sll n)
{
    sll ans = 0;
    ans += a;
    ans += (sll)(((d * r * (1 - (sll)pow(r, n-1)))/(1-r))%mod);
    ans -= (sll)((a + (n-1)*d)*(sll)pow(r, n)%mod);
    return (ans*b)/(1-r);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll d = 1;
    ll s = 0;
    for (int i = len-1; i >=0; i--)
    {
        ll kf = (i*(i+1)/2%mod);
        ll km = d;
        ll k = (kf * km)%mod;
        ans += (a[i] * ((k+s)%mod));
        s += ((len-i) * d%mod)%mod;
        d *= 10%mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll  long long
#define sll  long long

ll mod = (ll)(1e9 + 7);

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll f = 1;
    ll d = 1;
    ll s = 0;
    for (sll i = len - 1; i >= 0; i--)
    {
        ll k = ((i * (i + 1) / 2 * d) % mod);
        ans += (a[i] * ((k + s) % mod));
        s += (f * d) % mod;
        s %= mod;
        f += 1 % mod;
        d *= 10 % mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

#define sll long long

ll mod = (ll)(1e9 + 7);
sll c(sll a, sll d, sll b, sll r, sll n)
{
    sll ans = 0;
    ans += a;
    ans += (sll)(((d * r * (1 - (sll)pow(r, n - 1))) / (1 - r)) % mod);
    ans -= (sll)((a + (n - 1) * d) * (sll)pow(r, n) % mod);
    return (ans * b) / (1 - r);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll d = 1;
    ll s = 0;
    for (int i = len - 1; i >= 0; --i)
    {
        ll k = (i * (i + 1) / 2 % mod * d % mod + s) % mod;
        ans = (ans + a[i] * (k % mod)) % mod;
        s = (s + d * (len - i) % mod) % mod;
        d = d * 10 % mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

#define sll  long long

ll mod = (ll)(1e9 + 7);
sll c(sll a, sll d, sll b, sll r, sll n)
{
    sll ans = 0;
    ans += a;
    ans += (sll)(((d * r * (1 - (sll)pow(r, n-1)))/(1-r))%mod);
    ans -= (sll)((a + (n-1)*d)*(sll)pow(r, n)%mod);
    return (ans*b)/(1-r);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll d = 1;
    ll s = 0;
    for (int i = len-1; i >=0; i--)
    {
        ll kf = (i*(i+1)/2%mod);
        ll km = d;
        ll k = (kf * km)%mod;
        ans += (a[i] * ((k+s)%mod));
        s += ((len-i) * d%mod)%mod;
        d *= 10;
        d %= mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

#define sll long long

ll mod = (ll)(1e9 + 7);
sll c(sll a, sll d, sll b, sll r, sll n)
{
    sll ans = 0;
    ans += a;
    ans += (sll)(((d * r * (1 - (sll)pow(r, n - 1))) / (1 - r)) % mod);
    ans -= (sll)((a + (n - 1) * d) * (sll)pow(r, n) % mod);
    return (ans * b) / (1 - r);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll d = 1;
    ll s = 0;
    for (int i = len - 1; i >= 0; i--)
    {
        ll kf = (i * (i + 1) / 2 % mod * d % mod) % mod;
        ans += (a[i] * ((kf + s) % mod)) % mod;
        s += ((len - i) * d) % mod;
        d *= 10 % mod;
    }
    cout << ans % mod << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string.h>
using namespace std;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

#define ll unsigned long long

ll mod = (ll)(1e9 + 7);

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string n;
    cin >> n;
    int len = (int)n.size();

    ll a[len];
    for (int i = 0; i < len; i++)
    {
        a[i] = (ll)(n[i] - '0');
    }

    ll ans = 0;
    ll f = 1;
    ll d = 1;
    ll s = 0;
    for (int i = len-1; i >=0; i--)
    {
        ll k = (i*(i+1)/2%mod)%mod * (d%mod);
        ans += (a[i] * ((k+s)%mod));
        s += (f * d)%mod;
        s %= mod;
        f += 1%mod;
        d *= 10%mod;
    }
    cout << ans % mod << endl;
}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int N = 1e5 + 7;
const int MOD = 1e9 + 7;

ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}

ll mod_pow(ll num, ll pow)
{
    ll test;
    ll n = num;
    for(test = 1; pow; pow >>= 1) {
        if (pow & 1)
            test = ((test % MOD) * (n % MOD)) % MOD;
        n = ((n % MOD) * (n % MOD)) % MOD;
    }

    return test; /* note this is potentially lossy */
}

ll inv(ll base) {
    int g = MOD, r = base, x = 0, y = 1;
    while (r != 0) {
        int q = g / r;
        g %= r; swap(g, r);
        x -= q * y; swap(x, y);
    }
    return x < 0 ? x+MOD : x;
}

ll mul(ll A, ll B) {
	return (A*B)%MOD;
}

ll add(ll A, ll B) {
	return (A+B)%MOD;
}

ll dvd(ll A, ll B) {
    return mul(A, inv(B));
}

ll sub(ll A, ll B) {
    return (A-B+MOD)%MOD;
}

bool isPowerOfTwo (int x) {
	return x && (!(x & (x - 1)));
}

void findPowerSet(vector<int> const &S, int n)
{
	// N stores total number of subsets
	int N = pow(2, n);

	// generate each subset one by one
	for (int i = 0; i < N; i++)
	{
		// check every bit of i
		for (int j = 0; j < n; j++)
		{
			// if j'th bit of i is set, print S[j]
			if (i & (1 << j))
				cout << S[j] << " ";
		}
		cout << endl;
	}
}

long long contri(string s, int i) {
	int n = s.size();
	long long invSum = 0;
	long long prev = (((i * (i + 1)) % MOD) * mod_pow(10, n - i - 1) * dvd(1, 2)) % MOD;
	long long next = ((mod_pow(10, n - i - 1) * ((9 * (n - i - 1) - 1) % MOD) + 1 ) % MOD) * dvd(1, 81);
	invSum = ((s[i] - '0') % MOD) * add(prev, next % MOD);
	return invSum;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	//TAKE MODULO FACTORIAL !!!
	//BINARY SEARCH RUN

	string s;
    cin >> s;
    int n = s.size();
    long long val = 0;
	for(int i = 0; i < n; i++) {
		val += contri(s, i) % MOD;
	}
    cout << val % MOD << endl;

}


#include <bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
const int N = 1e5 + 7;
const int MOD = 1e9 + 7;

ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}

ll mod_pow(ll num, ll pow)
{
    ll test;
    ll n = num;
    for(test = 1; pow; pow >>= 1) {
        if (pow & 1)
            test = ((test % MOD) * (n % MOD)) % MOD;
        n = ((n % MOD) * (n % MOD)) % MOD;
    }

    return test; /* note this is potentially lossy */
}

ll inv(ll base) {
    int g = MOD, r = base, x = 0, y = 1;
    while (r != 0) {
        int q = g / r;
        g %= r; swap(g, r);
        x -= q * y; swap(x, y);
    }
    return x < 0 ? x+MOD : x;
}

ll mul(ll A, ll B) {
	return (A*B)%MOD;
}

ll add(ll A, ll B) {
	return (A+B)%MOD;
}

ll dvd(ll A, ll B) {
    return mul(A, inv(B));
}

ll sub(ll A, ll B) {
    return (A-B+MOD)%MOD;
}

bool isPowerOfTwo (int x) {
	return x && (!(x & (x - 1)));
}

void findPowerSet(vector<int> const &S, int n)
{
	// N stores total number of subsets
	int N = pow(2, n);

	// generate each subset one by one
	for (int i = 0; i < N; i++)
	{
		// check every bit of i
		for (int j = 0; j < n; j++)
		{
			// if j'th bit of i is set, print S[j]
			if (i & (1 << j))
				cout << S[j] << " ";
		}
		cout << endl;
	}
}

ll contri(string s, int i) {
	int n = s.size();
	ll invSum = 0;
	ll prev = ((i * (i + 1)) % MOD) * mod_pow(10, n - i - 1) * dvd(1, 2);
	ll next = ((mod_pow(10, n - i - 1) * ((9 * (n - i - 1) - 1) % MOD) + 1 ) % MOD) * dvd(1, 81);
	invSum = ((s[i] - '0') % MOD) * add(prev % MOD, next % MOD);
	return invSum;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	//TAKE MODULO FACTORIAL !!!
	//BINARY SEARCH RUN

	string s;
    cin >> s;
    int n = s.size();
    ll val = 0;
	for(int i = 0; i < n; i++) {
		val += contri(s, i) % MOD;
	}
    cout << val % MOD << endl;

}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e5 + 7;
const ll MOD = 1e9 + 7;

ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}

ll mod_pow(ll num, ll pow)
{
    ll test;
    ll n = num;
    for(test = 1; pow; pow >>= 1) {
        if (pow & 1)
            test = ((test % MOD) * (n % MOD)) % MOD;
        n = ((n % MOD) * (n % MOD)) % MOD;
    }

    return test; /* note this is potentially lossy */
}

ll inv(ll base) {
    int g = MOD, r = base, x = 0, y = 1;
    while (r != 0) {
        int q = g / r;
        g %= r; swap(g, r);
        x -= q * y; swap(x, y);
    }
    return x < 0 ? x+MOD : x;
}

ll mul(ll A, ll B) {
	return (A*B)%MOD;
}

ll add(ll A, ll B) {
	return (A+B)%MOD;
}

ll dvd(ll A, ll B) {
    return mul(A, inv(B));
}

ll sub(ll A, ll B) {
    return (A-B+MOD)%MOD;
}

bool isPowerOfTwo (int x) {
	return x && (!(x & (x - 1)));
}

void findPowerSet(vector<int> const &S, int n)
{
	// N stores total number of subsets
	int N = pow(2, n);

	// generate each subset one by one
	for (int i = 0; i < N; i++)
	{
		// check every bit of i
		for (int j = 0; j < n; j++)
		{
			// if j'th bit of i is set, print S[j]
			if (i & (1 << j))
				cout << S[j] << " ";
		}
		cout << endl;
	}
}

ll contri(string s, ll i) {
	ll n = s.size();
	ll invSum = 0;
	ll prev = ((((i * (i + 1)) % MOD) * mod_pow(10, n - i - 1)) % MOD) * dvd(1, 2);
	ll next = ((mod_pow(10, n - i - 1) * ((9 * (n - i - 1) - 1) % MOD) + 1 ) % MOD) * dvd(1, 81);
	invSum = ((s[(int)i] - '0') % MOD) * add(prev % MOD, next % MOD);
	return invSum;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	//TAKE MODULO FACTORIAL !!!
	//BINARY SEARCH RUN

	string s;
    cin >> s;
    int n = s.size();
    ll val = 0;
	for(ll i = 0; i < n; i++) {
		val += contri(s, i) % MOD;
	}
    cout << val % MOD << endl;

}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int N = 1e5 + 7;
const int MOD = 1e9 + 7;

ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}

ll inv(ll base) {
    int g = MOD, r = base, x = 0, y = 1;
    while (r != 0) {
        int q = g / r;
        g %= r; swap(g, r);
        x -= q * y; swap(x, y);
    }
    return x < 0 ? x+MOD : x;
}

ll mul(ll A, ll B) {
	return (A*B)%MOD;
}

ll add(ll A, ll B) {
	return (A+B)%MOD;
}

ll dvd(ll A, ll B) {
    return mul(A, inv(B));
}

ll sub(ll A, ll B) {
    return (A-B+MOD)%MOD;
}

bool isPowerOfTwo (int x) {
	return x && (!(x & (x - 1)));
}

void findPowerSet(vector<int> const &S, int n)
{
	// N stores total number of subsets
	int N = pow(2, n);

	// generate each subset one by one
	for (int i = 0; i < N; i++)
	{
		// check every bit of i
		for (int j = 0; j < n; j++)
		{
			// if j'th bit of i is set, print S[j]
			if (i & (1 << j))
				cout << S[j] << " ";
		}
		cout << endl;
	}
}

long long contri(string s, int i) {
	int n = s.size();
	long long invSum = 0;
	long long prev = ((i * (i + 1)) % MOD) * modExp(10, n - i - 1) * dvd(1, 2);
	long long next = ((modExp(10, n - i - 1) * ((9 * (n - i - 1) - 1) % MOD) + 1 ) % MOD) * dvd(1, 81);
	invSum = ((s[i] - '0') % MOD) * add(prev % MOD, next % MOD);
	return invSum;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	//TAKE MODULO FACTORIAL !!!
	//BINARY SEARCH RUN

	string s;
    cin >> s;
    int n = s.size();
    long long val = 0;
	for(int i = 0; i < n; i++) {
		val += contri(s, i) % MOD;
	}
    cout << val % MOD << endl;

}


#include <bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
const int N = 1e5 + 7;
const int MOD = 1e9 + 7;

ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}

ll mod_pow(ll num, ll pow)
{
    ll test;
    ll n = num;
    for(test = 1; pow; pow >>= 1) {
        if (pow & 1)
            test = ((test % MOD) * (n % MOD)) % MOD;
        n = ((n % MOD) * (n % MOD)) % MOD;
    }

    return test; /* note this is potentially lossy */
}

ll inv(ll base) {
    int g = MOD, r = base, x = 0, y = 1;
    while (r != 0) {
        int q = g / r;
        g %= r; swap(g, r);
        x -= q * y; swap(x, y);
    }
    return x < 0 ? x+MOD : x;
}

ll mul(ll A, ll B) {
	return (A*B)%MOD;
}

ll add(ll A, ll B) {
	return (A+B)%MOD;
}

ll dvd(ll A, ll B) {
    return mul(A, inv(B));
}

ll sub(ll A, ll B) {
    return (A-B+MOD)%MOD;
}

bool isPowerOfTwo (int x) {
	return x && (!(x & (x - 1)));
}

void findPowerSet(vector<int> const &S, int n)
{
	// N stores total number of subsets
	int N = pow(2, n);

	// generate each subset one by one
	for (int i = 0; i < N; i++)
	{
		// check every bit of i
		for (int j = 0; j < n; j++)
		{
			// if j'th bit of i is set, print S[j]
			if (i & (1 << j))
				cout << S[j] << " ";
		}
		cout << endl;
	}
}

ll contri(string s, int i) {
	int n = s.size();
	ll invSum = 0;
	ll prev = ((((i * (i + 1)) % MOD) * mod_pow(10, n - i - 1)) % MOD) * dvd(1, 2);
	ll next = ((mod_pow(10, n - i - 1) * ((9 * (n - i - 1) - 1) % MOD) + 1 ) % MOD) * dvd(1, 81);
	invSum = ((s[i] - '0') % MOD) * add(prev % MOD, next % MOD);
	return invSum;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	//TAKE MODULO FACTORIAL !!!
	//BINARY SEARCH RUN

	string s;
    cin >> s;
    int n = s.size();
    ll val = 0;
	for(int i = 0; i < n; i++) {
		val += contri(s, i) % MOD;
	}
    cout << val % MOD << endl;

}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e5 + 7;
const int MOD = 1e9 + 7;

ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}

ll mod_pow(ll num, ll pow)
{
    ll test;
    ll n = num;
    for(test = 1; pow; pow >>= 1) {
        if (pow & 1)
            test = ((test % MOD) * (n % MOD)) % MOD;
        n = ((n % MOD) * (n % MOD)) % MOD;
    }

    return test; /* note this is potentially lossy */
}

ll inv(ll base) {
    int g = MOD, r = base, x = 0, y = 1;
    while (r != 0) {
        int q = g / r;
        g %= r; swap(g, r);
        x -= q * y; swap(x, y);
    }
    return x < 0 ? x+MOD : x;
}

ll mul(ll A, ll B) {
	return (A*B)%MOD;
}

ll add(ll A, ll B) {
	return (A+B)%MOD;
}

ll dvd(ll A, ll B) {
    return mul(A, inv(B));
}

ll sub(ll A, ll B) {
    return (A-B+MOD)%MOD;
}

bool isPowerOfTwo (int x) {
	return x && (!(x & (x - 1)));
}

void findPowerSet(vector<int> const &S, int n)
{
	// N stores total number of subsets
	int N = pow(2, n);

	// generate each subset one by one
	for (int i = 0; i < N; i++)
	{
		// check every bit of i
		for (int j = 0; j < n; j++)
		{
			// if j'th bit of i is set, print S[j]
			if (i & (1 << j))
				cout << S[j] << " ";
		}
		cout << endl;
	}
}

ll contri(string s, int i) {
	int n = s.size();
	ll invSum = 0;
	ll prev = ((((i * (i + 1)) % MOD) * mod_pow(10, n - i - 1)) % MOD) * dvd(1, 2);
	ll next = ((mod_pow(10, n - i - 1) * ((9 * (n - i - 1) - 1) % MOD) + 1 ) % MOD) * dvd(1, 81);
	invSum = ((s[i] - '0') % MOD) * add(prev % MOD, next % MOD);
	return invSum;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	//TAKE MODULO FACTORIAL !!!
	//BINARY SEARCH RUN

	string s;
    cin >> s;
    int n = s.size();
    ll val = 0;
	for(int i = 0; i < n; i++) {
		val += contri(s, i) % MOD;
	}
    cout << val % MOD << endl;

}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int N = 1e5 + 7;
const int MOD = 1e9 + 7;

ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}

ll mod_pow(ll num, ll pow)
{
    ll test;
    ll n = num;
    for(test = 1; pow; pow >>= 1) {
        if (pow & 1)
            test = ((test % MOD) * (n % MOD)) % MOD;
        n = ((n % MOD) * (n % MOD)) % MOD;
    }

    return test; /* note this is potentially lossy */
}

ll inv(ll base) {
    int g = MOD, r = base, x = 0, y = 1;
    while (r != 0) {
        int q = g / r;
        g %= r; swap(g, r);
        x -= q * y; swap(x, y);
    }
    return x < 0 ? x+MOD : x;
}

ll mul(ll A, ll B) {
	return (A*B)%MOD;
}

ll add(ll A, ll B) {
	return (A+B)%MOD;
}

ll dvd(ll A, ll B) {
    return mul(A, inv(B));
}

ll sub(ll A, ll B) {
    return (A-B+MOD)%MOD;
}

bool isPowerOfTwo (int x) {
	return x && (!(x & (x - 1)));
}

void findPowerSet(vector<int> const &S, int n)
{
	// N stores total number of subsets
	int N = pow(2, n);

	// generate each subset one by one
	for (int i = 0; i < N; i++)
	{
		// check every bit of i
		for (int j = 0; j < n; j++)
		{
			// if j'th bit of i is set, print S[j]
			if (i & (1 << j))
				cout << S[j] << " ";
		}
		cout << endl;
	}
}

long long contri(string s, int i) {
	int n = s.size();
	long long invSum = 0;
	long long prev = ((i * (i + 1)) % MOD) * mod_pow(10, n - i - 1) * dvd(1, 2);
	long long next = ((mod_pow(10, n - i - 1) * ((9 * (n - i - 1) - 1) % MOD) + 1 ) % MOD) * dvd(1, 81);
	invSum = ((s[i] - '0') % MOD) * add(prev % MOD, next % MOD);
	return invSum;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	//TAKE MODULO FACTORIAL !!!
	//BINARY SEARCH RUN

	string s;
    cin >> s;
    int n = s.size();
    long long val = 0;
	for(int i = 0; i < n; i++) {
		val += contri(s, i) % MOD;
	}
    cout << val % MOD << endl;

}


#include <bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
const int N = 1e5 + 7;
const int MOD = 1e9 + 7;

ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}

ll mod_pow(ll num, ll pow)
{
    ll test;
    ll n = num;
    for(test = 1; pow; pow >>= 1) {
        if (pow & 1)
            test = ((test % MOD) * (n % MOD)) % MOD;
        n = ((n % MOD) * (n % MOD)) % MOD;
    }

    return test; /* note this is potentially lossy */
}

ll inv(ll base) {
    int g = MOD, r = base, x = 0, y = 1;
    while (r != 0) {
        int q = g / r;
        g %= r; swap(g, r);
        x -= q * y; swap(x, y);
    }
    return x < 0 ? x+MOD : x;
}

ll mul(ll A, ll B) {
	return (A*B)%MOD;
}

ll add(ll A, ll B) {
	return (A+B)%MOD;
}

ll dvd(ll A, ll B) {
    return mul(A, inv(B));
}

ll sub(ll A, ll B) {
    return (A-B+MOD)%MOD;
}

bool isPowerOfTwo (int x) {
	return x && (!(x & (x - 1)));
}

void findPowerSet(vector<int> const &S, int n)
{
	// N stores total number of subsets
	int N = pow(2, n);

	// generate each subset one by one
	for (int i = 0; i < N; i++)
	{
		// check every bit of i
		for (int j = 0; j < n; j++)
		{
			// if j'th bit of i is set, print S[j]
			if (i & (1 << j))
				cout << S[j] << " ";
		}
		cout << endl;
	}
}

ll contri(string s, int i) {
	int n = s.size();
	ll invSum = 0;
	ll prev = mul(((i * (i + 1)) % MOD), mod_pow(10, n - i - 1)) * dvd(1, 2);
	ll next = ((mod_pow(10, n - i - 1) * ((9 * (n - i - 1) - 1) % MOD) + 1 ) % MOD) * dvd(1, 81);
	invSum = ((s[i] - '0') % MOD) * add(prev % MOD, next % MOD);
	return invSum;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	//TAKE MODULO FACTORIAL !!!
	//BINARY SEARCH RUN

	string s;
    cin >> s;
    int n = s.size();
    ll val = 0;
	for(int i = 0; i < n; i++) {
		val += contri(s, i) % MOD;
	}
    cout << val % MOD << endl;

}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e5 + 7;
const ll MOD = 1e9 + 7;

ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}

ll inv(ll base) {
    int g = MOD, r = base, x = 0, y = 1;
    while (r != 0) {
        int q = g / r;
        g %= r; swap(g, r);
        x -= q * y; swap(x, y);
    }
    return x < 0 ? x+MOD : x;
}

ll mul(ll A, ll B) {
	return (A*B)%MOD;
}

ll add(ll A, ll B) {
	return (A+B)%MOD;
}

ll dvd(ll A, ll B) {
    return mul(A, inv(B));
}

ll sub(ll A, ll B) {
    return (A-B+MOD)%MOD;
}

bool isPowerOfTwo (int x) {
	return x && (!(x & (x - 1)));
}

void findPowerSet(vector<int> const &S, int n)
{
	// N stores total number of subsets
	int N = pow(2, n);

	// generate each subset one by one
	for (int i = 0; i < N; i++)
	{
		// check every bit of i
		for (int j = 0; j < n; j++)
		{
			// if j'th bit of i is set, print S[j]
			if (i & (1 << j))
				cout << S[j] << " ";
		}
		cout << endl;
	}
}

ll contri(string s, ll i) {
	ll n = s.size();
	ll invSum = 0;
	ll prev = ((((i * (i + 1)) % MOD) * modExp(10, n - i - 1)) % MOD) * dvd(1, 2);
	ll next = ((modExp(10, n - i - 1) * ((9 * (n - i - 1) - 1) % MOD) + 1 ) % MOD) * dvd(1, 81);
	invSum = ((s[(int)i] - '0') % MOD) * add(prev % MOD, next % MOD);
	return invSum;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	//TAKE MODULO FACTORIAL !!!
	//BINARY SEARCH RUN

	string s;
    cin >> s;
    int n = s.size();
    ll val = 0;
	for(ll i = 0; i < n; i++) {
		val += contri(s, i) % MOD;
	}
    cout << val % MOD << endl;

}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n';

ll fac(ll n, ll md){
    return ((n*(n+1))/2)%md;
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;cin>>s;
    ll n = s.size();
    ll tpw[n+1], smtpw[n+1], md = 1e9 + 7, ans = 0;
    tpw[0] = smtpw[0] = 1;
    for(int i = 1; i <= n; ++i){
        tpw[i] = 10*tpw[i-1];
        tpw[i] %= md;
        smtpw[i] = smtpw[i-1] + tpw[i]*(i+1);
        smtpw[i] %= md;
    }
    for(int i = n - 1; i >=0; --i){
        ll lol = n - i  - 1, temp = 0;
        if(lol){
            temp = s[i]-'0';
            temp *=smtpw[lol-1];
            //cout<<temp<<" dbg1"<<" ";
            temp%=md;
            ans += temp;
            ans %= md;
        }
        temp = s[i] - '0';
        temp *= fac(i, md);
        temp%=md;
        temp*=tpw[lol];
        temp%=md;
        //cout<<temp<<" dbg2"<<endl;
        ans += temp;
        ans %= md;
    }
    cout<<ans<<endl;
    return 0;

}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n';

ll binpow(ll a, ll b, ll md){
    ll ans = 1;
    while(b){
        if(b&1) ans *= a;
        b/=2;
        a*=a;
        ans %= md;
        a%=md;
    }
    return ans;
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;cin>>s;
    int n = s.size();
    ll tenpw[n+1], TPW[n+1], twopw[n+1], preftenpw[n+1], preftwopw[n+1], md = 1e9 + 7;
    tenpw[0] = twopw[0] = preftenpw[0] = preftwopw[0] = 1, TPW[0] = 1;
    ll fact[n+1];
    fact[0] = 1;
    for(int i = 1; i<= n; ++i){
        TPW[i] = 10*TPW[i-1];
        tenpw[i] = 5*tenpw[i-1];
        twopw[i] = 2*twopw[i-1];
        tenpw[i] %= md;
        twopw[i] %= md;
        preftenpw[i] = tenpw[i] + preftenpw[i-1];
        preftwopw[i] = twopw[i] + preftwopw[i-1];
        preftenpw[i] %= md;
        preftwopw[i] %= md;
        fact[i] = fact[i-1]*i;
        fact[i] %= md;
    }
    ll ans = 0;
    for(int i = n-1; i>=0; --i){
        ll temp = 0;
        if(i) temp = (twopw[i]-1)*TPW[n-i-1]%md;
        temp *= s[i] -'0';
        temp%=md;
        ll lol = n - i - 1;
        ll temp2 = 0;
        if(i!=n-1){
            for(int i = 1; i <= lol; ++i){
                ll T = fact[lol];
                ll G = fact[lol-i]*fact[i];
                G%= md;
                T*=binpow(G, md-2, md);
                T%=md;
                T*=TPW[lol-i];
                T%=md;
                temp2 += T;
                temp2%=md;
            }
        }
        temp2%=md;
        temp2*=(s[i] -'0')%md;
        //cout<<temp<<" "<<temp2<<endl;
        ans += temp2;
        ans %= md;
        ans += temp;
        ans %= md;
    }
    ll suff[n+1], tn = 1;
    suff[0] = 0;
    for(int i = 1; i<=n; ++i){
        suff[i] = s[i-1]-'0';
        suff[i] %= md;
        suff[i] += suff[i-1]*10%md;
        suff[i] %= md;
        tn*=10;
        tn%=md;
    }
    for(int i = 0; i < n; ++i){
        for(int j = i; j < n; ++j){
            ll temp = suff[j+1];
            if(i > 0){
                temp%=md;
                ll K = suff[0] - suff[i] + md;
                K%=md;
                K*=binpow(TPW[j-i + 1], md-2, md);
                K%=md;
                temp += K;
            }
            temp%=md;
            ans += temp;
            ans %=md;
        }
    }
    ans = 0;
    for(int i = 0, LOL = 0; i<n; ++i){
        ans += suff[n]*(i+1);
        ans %= md;
        ans -= ((i+1)*suff[i+1]%md*TPW[n-i-1])%md;
        ans += md;
        ans %= md;
        ans += LOL*TPW[n-i-1];
        ans%=md;
        LOL += suff[i+1]%md;
    }
    cout<<ans<<endl;
    return 0;

}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n';

ll binpow(ll a, ll b, ll md){
    ll ans = 1;
    while(b){
        if(b&1) ans *= a;
        b/=2;
        a*=a;
        ans %= md;
        a%=md;
    }
    return ans;
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;cin>>s;
    int n = s.size();
    ll tenpw[n+1], TPW[n+1], twopw[n+1], preftenpw[n+1], preftwopw[n+1], md = 1e9 + 7;
    tenpw[0] = twopw[0] = preftenpw[0] = preftwopw[0] = 1, TPW[0] = 1;
    ll fact[n+1];
    fact[0] = 1;
    for(int i = 1; i<= n; ++i){
        TPW[i] = 10*TPW[i-1];
        tenpw[i] = 5*tenpw[i-1];
        twopw[i] = 2*twopw[i-1];
        tenpw[i] %= md;
        twopw[i] %= md;
        preftenpw[i] = tenpw[i] + preftenpw[i-1];
        preftwopw[i] = twopw[i] + preftwopw[i-1];
        preftenpw[i] %= md;
        preftwopw[i] %= md;
        fact[i] = fact[i-1]*i;
        fact[i] %= md;
    }
    ll ans = 0;
    for(int i = n-1; i>=0; --i){
        ll temp = 0;
        if(i) temp = (twopw[i]-1)*TPW[n-i-1]%md;
        temp *= s[i] -'0';
        temp%=md;
        ll lol = n - i - 1;
        ll temp2 = 0;
        if(i!=n-1){
            for(int i = 1; i <= lol; ++i){
                ll T = fact[lol];
                ll G = fact[lol-i]*fact[i];
                G%= md;
                T*=binpow(G, md-2, md);
                T%=md;
                T*=TPW[lol-i];
                T%=md;
                temp2 += T;
                temp2%=md;
            }
        }
        temp2%=md;
        temp2*=(s[i] -'0')%md;
        //cout<<temp<<" "<<temp2<<endl;
        ans += temp2;
        ans %= md;
        ans += temp;
        ans %= md;
    }
    ll suff[n+1], tn = 1;
    suff[0] = 0;
    for(int i = 1; i<=n; ++i){
        suff[i] = s[i-1]-'0';
        suff[i] %= md;
        suff[i] += suff[i-1]*10%md;
        suff[i] %= md;
        tn*=10;
        tn%=md;
    }
    for(int i = 0; i < n; ++i){
        for(int j = i; j < n; ++j){
            ll temp = suff[j+1];
            if(i > 0){
                temp%=md;
                ll K = suff[0] - suff[i] + md;
                K%=md;
                K*=binpow(TPW[j-i + 1], md-2, md);
                K%=md;
                temp += K;
            }
            temp%=md;
            ans += temp;
            ans %=md;
        }
    }
    ans = 0;
    for(ll i = 1, LOL = 0; i<=n; ++i){
        ans += suff[n]*(i)%md;;
        ans %= md;
        ans -= ((i)*suff[i]%md*TPW[n-i])%md;
        ans += md;
        ans %= md;
        ans += LOL*TPW[n-i]%md;;
        ans%=md;
        LOL += suff[i]%md;
        LOL%=md;
    }
    cout<<ans<<endl;
    return 0;

}


#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 1e5 + 5;
const int HENTAI = 1e9 + 7;
signed main()
{
    int FUCKKKKKKKKKKKKKK[N], YOU[N], n;
    string s;
    cin >> s;
    n = s.size();
    s = ' ' + s;
    YOU[0] = 1;
    for (int i = 1; i <= n; i++)
    {
        YOU[i] = YOU[i - 1] * 10 % HENTAI;
        FUCKKKKKKKKKKKKKK[i] = FUCKKKKKKKKKKKKKK[i - 1] * 10 % HENTAI + s[i] - '0';
        FUCKKKKKKKKKKKKKK[i] %= HENTAI;
    }
    int MADAFAKA_IZZZ_EXPERT = 0;
    for (int i = 1, T = 0; i <= n; i++)
    {
        MADAFAKA_IZZZ_EXPERT += FUCKKKKKKKKKKKKKK[n] * i % HENTAI;
        MADAFAKA_IZZZ_EXPERT %= HENTAI;
        MADAFAKA_IZZZ_EXPERT -= (i)*FUCKKKKKKKKKKKKKK[i] % HENTAI * YOU[n - i] % HENTAI - HENTAI;
        MADAFAKA_IZZZ_EXPERT%=HENTAI;
        MADAFAKA_IZZZ_EXPERT +=  T * YOU[n - i]%HENTAI;
        MADAFAKA_IZZZ_EXPERT%=HENTAI;
        T = (T + FUCKKKKKKKKKKKKKK[i]) % HENTAI;
    }
    cout << MADAFAKA_IZZZ_EXPERT << '\n';
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n';

ll fac(ll n, ll md){
    return ((n*(n+1))/2)%md;
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;cin>>s;
    ll n = s.size();
    ll tn = 1, sm = 0, md = 1e9 + 7, ans = 0, j = 1;
    for(int i = n - 1; i >=0; --i, ++j){
        ll temp = s[i] - '0';
        temp *= sm;
        temp%=md;
        ans += temp;
        ans %= md;
        sm += tn*j;
        temp = s[i] - '0';
        temp *= fac(i, md);
        temp%=md;
        temp*=tn;
        temp%=md;
        tn*=10;
        tn%=md;
        j%=md;sm%=md;
        ans += temp;
        ans %= md;
    }
    cout<<ans<<endl;
    return 0;

}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n';

ll binpow(ll a, ll b, ll md){
    ll ans = 1;
    while(b){
        if(b&1) ans *= a;
        b/=2;
        a*=a;
        ans %= md;
        a%=md;
    }
    return ans;
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;cin>>s;
    int n = s.size();
    ll tenpw[n+1], TPW[n+1], twopw[n+1], preftenpw[n+1], preftwopw[n+1], md = 1e9 + 7;
    tenpw[0] = twopw[0] = preftenpw[0] = preftwopw[0] = 1, TPW[0] = 1;
    ll fact[n+1];
    fact[0] = 1;
    for(int i = 1; i<= n; ++i){
        TPW[i] = 10*TPW[i-1];
        tenpw[i] = 5*tenpw[i-1];
        twopw[i] = 2*twopw[i-1];
        tenpw[i] %= md;
        twopw[i] %= md;
        preftenpw[i] = tenpw[i] + preftenpw[i-1];
        preftwopw[i] = twopw[i] + preftwopw[i-1];
        preftenpw[i] %= md;
        preftwopw[i] %= md;
        fact[i] = fact[i-1]*i;
        fact[i] %= md;
    }
    ll ans = 0;
    for(int i = n-1; i>=0; --i){
        ll temp = 0;
        if(i) temp = (twopw[i]-1)*TPW[n-i-1]%md;
        temp *= s[i] -'0';
        temp%=md;
        ll lol = n - i - 1;
        ll temp2 = 0;
        if(i!=n-1){
            for(int i = 1; i <= lol; ++i){
                ll T = fact[lol];
                ll G = fact[lol-i]*fact[i];
                G%= md;
                T*=binpow(G, md-2, md);
                T%=md;
                T*=TPW[lol-i];
                T%=md;
                temp2 += T;
                temp2%=md;
            }
        }
        temp2%=md;
        temp2*=(s[i] -'0')%md;
        //cout<<temp<<" "<<temp2<<endl;
        ans += temp2;
        ans %= md;
        ans += temp;
        ans %= md;
    }
    ll suff[n+1], tn = 1;
    suff[0] = 0;
    for(int i = 1; i<=n; ++i){
        suff[i] = s[i-1]-'0';
        suff[i] %= md;
        suff[i] += suff[i-1]*10%md;
        suff[i] %= md;
        tn*=10;
        tn%=md;
    }
    for(int i = 0; i < n; ++i){
        for(int j = i; j < n; ++j){
            ll temp = suff[j+1];
            if(i > 0){
                temp%=md;
                ll K = suff[0] - suff[i] + md;
                K%=md;
                K*=binpow(TPW[j-i + 1], md-2, md);
                K%=md;
                temp += K;
            }
            temp%=md;
            ans += temp;
            ans %=md;
        }
    }
    ans = 0;
    for(int i = 1, LOL = 0; i<=n; ++i){
        ans += suff[n]*(i);
        ans %= md;
        ans -= ((i)*suff[i]%md*TPW[n-i])%md;
        ans += md;
        ans %= md;
        ans += LOL*TPW[n-i]%md;;
        ans%=md;
        LOL += suff[i]%md;
        LOL%=md;
    }
    cout<<ans<<endl;
    return 0;

}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n';

ll binpow(ll a, ll b, ll md){
    ll ans = 1;
    while(b){
        if(b&1) ans *= a;
        b/=2;
        a*=a;
        ans %= md;
        a%=md;
    }
    return ans;
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;cin>>s;
    int n = s.size();
    ll tenpw[n+1], TPW[n+1], twopw[n+1], preftenpw[n+1], preftwopw[n+1], md = 1e9 + 7;
    tenpw[0] = twopw[0] = preftenpw[0] = preftwopw[0] = 1, TPW[0] = 1;
    ll fact[n+1];
    fact[0] = 1;
    for(int i = 1; i<= n; ++i){
        TPW[i] = 10*TPW[i-1];
        tenpw[i] = 5*tenpw[i-1];
        twopw[i] = 2*twopw[i-1];
        tenpw[i] %= md;
        twopw[i] %= md;
        preftenpw[i] = tenpw[i] + preftenpw[i-1];
        preftwopw[i] = twopw[i] + preftwopw[i-1];
        preftenpw[i] %= md;
        preftwopw[i] %= md;
        fact[i] = fact[i-1]*i;
        fact[i] %= md;
    }
    ll ans = 0;
    for(int i = n-1; i>=0; --i){
        ll temp = 0;
        if(i) temp = (twopw[i]-1)*TPW[n-i-1]%md;
        temp *= s[i] -'0';
        temp%=md;
        ll lol = n - i - 1;
        ll temp2 = 0;
        if(i!=n-1){
            for(int i = 1; i <= lol; ++i){
                ll T = fact[lol];
                ll G = fact[lol-i]*fact[i];
                G%= md;
                T*=binpow(G, md-2, md);
                T%=md;
                T*=TPW[lol-i];
                T%=md;
                temp2 += T;
                temp2%=md;
            }
        }
        temp2%=md;
        temp2*=(s[i] -'0')%md;
        //cout<<temp<<" "<<temp2<<endl;
        ans += temp2;
        ans %= md;
        ans += temp;
        ans %= md;
    }
    ll suff[n+1], tn = 1;
    suff[0] = 0;
    for(int i = 1; i<=n; ++i){
        suff[i] = s[i-1]-'0';
        suff[i] %= md;
        suff[i] += suff[i-1]*10%md;
        suff[i] %= md;
        tn*=10;
        tn%=md;
    }
    for(int i = 0; i < n; ++i){
        for(int j = i; j < n; ++j){
            ll temp = suff[j+1];
            if(i > 0){
                temp%=md;
                ll K = suff[0] - suff[i] + md;
                K%=md;
                K*=binpow(TPW[j-i + 1], md-2, md);
                K%=md;
                temp += K;
            }
            temp%=md;
            ans += temp;
            ans %=md;
        }
    }
    ans = 0;
    for(ll i = 1, LOL = 0; i<=n; ++i){
        ans += suff[n]*(i);
        ans %= md;
        ans -= ((i)*suff[i]%md*TPW[n-i])%md;
        ans += md;
        ans %= md;
        ans += LOL*TPW[n-i]%md;;
        ans%=md;
        LOL += suff[i]%md;
        LOL%=md;
    }
    cout<<ans<<endl;
    return 0;

}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n';

ll binpow(ll a, ll b, ll md){
    ll ans = 1;
    while(b){
        if(b&1) ans *= a;
        b/=2;
        a*=a;
        ans %= md;
        a%=md;
    }
    return ans;
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;cin>>s;
    int n = s.size();
    ll tenpw[n+1], TPW[n+1], twopw[n+1], preftenpw[n+1], preftwopw[n+1], md = 1e9 + 7;
    tenpw[0] = twopw[0] = preftenpw[0] = preftwopw[0] = 1, TPW[0] = 1;
    ll fact[n+1];
    fact[0] = 1;
    for(int i = 1; i<= n; ++i){
        TPW[i] = 10*TPW[i-1];
        tenpw[i] = 5*tenpw[i-1];
        twopw[i] = 2*twopw[i-1];
        tenpw[i] %= md;
        twopw[i] %= md;
        preftenpw[i] = tenpw[i] + preftenpw[i-1];
        preftwopw[i] = twopw[i] + preftwopw[i-1];
        preftenpw[i] %= md;
        preftwopw[i] %= md;
        fact[i] = fact[i-1]*i;
        fact[i] %= md;
    }
    ll ans = 0;
    for(int i = n-1; i>=0; --i){
        ll temp = 0;
        if(i) temp = (twopw[i]-1)*TPW[n-i-1]%md;
        temp *= s[i] -'0';
        temp%=md;
        ll lol = n - i - 1;
        ll temp2 = 0;
        if(i!=n-1){
            for(int i = 1; i <= lol; ++i){
                ll T = fact[lol];
                ll G = fact[lol-i]*fact[i];
                G%= md;
                T*=binpow(G, md-2, md);
                T%=md;
                T*=TPW[lol-i];
                T%=md;
                temp2 += T;
                temp2%=md;
            }
        }
        temp2%=md;
        temp2*=(s[i] -'0')%md;
        //cout<<temp<<" "<<temp2<<endl;
        ans += temp2;
        ans %= md;
        ans += temp;
        ans %= md;
    }
    ll suff[n+1], tn = 1;
    suff[0] = 0;
    for(int i = 1; i<=n; ++i){
        suff[i] = s[i-1]-'0';
        suff[i] %= md;
        suff[i] += suff[i-1]*10%md;
        suff[i] %= md;
        tn*=10;
        tn%=md;
    }
    for(int i = 0; i < n; ++i){
        for(int j = i; j < n; ++j){
            ll temp = suff[j+1];
            if(i > 0){
                temp%=md;
                ll K = suff[0] - suff[i] + md;
                K%=md;
                K*=binpow(TPW[j-i + 1], md-2, md);
                K%=md;
                temp += K;
            }
            temp%=md;
            ans += temp;
            ans %=md;
        }
    }
    ans = 0;
    for(int i = 0, LOL = 0; i<n; ++i){
        ans += suff[n]*(i+1);
        ans %= md;
        ans -= ((i+1)*suff[i+1]%md*TPW[n-i-1]);
        ans += md;
        ans %= md;
        ans += LOL*TPW[n-i-1];
        ans%=md;
        LOL += suff[i+1]%md;
    }
    cout<<ans<<endl;
    return 0;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
using namespace std::chrono;

#define ll long long
#define ld long double
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(c) ((ll)c.size())
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#ifdef LL
const ll inf = 1e9;
#else
const ll inf = 1e18;
#endif

const int mod = 1e9 + 7;
const int mod2 = 998244353;

typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;

// lower bound returns first element greater than the value

high_resolution_clock::time_point curTime() { return high_resolution_clock::now(); }
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);} //Just add this as a third argument to sort() while sorting an array of pairs; NO NEED FOR ANY ARGUMENTS;
template <typename T>
T fact(T a, T modulus){ int res = 1, i; for (i = 2; i <= a; i++){ res *= i; res%=modulus;} return res; }
template <typename T>
ll powmod(T a,T b,ll m){ ll ans=1; while(b>0){if(b&1){ans*=a;ans%=m;}a*=a;a%=m;b>>=1;} return ans; }
template <typename T>
ll power(T a, T b){ ll ans=1; while(b>0){if(b&1){ans*=a;}a*=a;b>>=1;}return ans;}
template <typename T>
T gcd(T a,T b){ return (b?__gcd(a,b):a); }
template <typename T>
T lcm(T a, T b){ return (a*(b/gcd(a,b))); }
template <typename T>
T cl(T a, T b){ return (a+b-1)/b; }
template <typename T>
T set_bits(T a)
{ return __builtin_popcount(a); }
template <typename T>
T add_self(T& a, T b, T modulus){ a+=b; if(a>=modulus){ a-=modulus; } }
template <typename T>
T to_upper(T s){ transform(s.begin(), s.end(), s.begin(), ::toupper); return s; }
template <typename T>
T to_lower(T s){ transform(s.begin(), s.end(), s.begin(), ::tolower); return s; }

#define rep(i,n) for(int i=0;i<n;i++)

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);
    auto startTime = curTime();

    string s;
    cin>>s;

    int n = sz(s);

    vi sum(n);
    vi pref(n);
    pref[0] = s[0]-'0';
    for(int i=1;i<n;i++)
    {
        pref[i] = pref[i-1] + (s[i]-'0');
        pref[i]%=mod;
    }

    for(int i=n-1;i>=0;i--)
    {
        sum[i] = ((s[i]-'0')*(i*(i+1)/2)%mod)%mod;
        if(i>0) sum[i] = (sum[i] + ((n-i)*pref[i-1])%mod)%mod;
        sum[i]%=mod;
    }
    //rep(i,n) cout<<sum[i]<<" ";
    //cout<<endl;

    ll ans=0;
    ll cnt=0;
    for(int i=n-1;i>=0;i--)
    {
        sum[i]%=mod;
        ans = (ans + (powmod((ll)10,cnt,mod)*sum[i])%mod)%mod;
        ans%=mod;
        cnt++;
    }

    cout<<ans<<endl;

    auto stopTime = curTime();
    auto duration = duration_cast<microseconds>(stopTime - startTime);
    //cout<<"Program ran for "<<(ld)duration.count()/1e6<<" "<<"seconds"<<endl;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
using namespace std::chrono;

#define ll long long
#define ld long double
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(c) ((ll)c.size())
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#ifdef LL
const ll inf = 1e9;
#else
const ll inf = 1e18;
#endif

const int mod = 1e9 + 7;
const int mod2 = 998244353;

typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;

// lower bound returns first element greater than the value

high_resolution_clock::time_point curTime() { return high_resolution_clock::now(); }
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);} //Just add this as a third argument to sort() while sorting an array of pairs; NO NEED FOR ANY ARGUMENTS;
template <typename T>
T fact(T a, T modulus){ int res = 1, i; for (i = 2; i <= a; i++){ res *= i; res%=modulus;} return res; }
template <typename T>
ll powmod(T a,T b,ll m){ ll ans=1; while(b>0){if(b&1){ans*=a;ans%=m;}a*=a;a%=m;b>>=1;} return ans; }
template <typename T>
ll power(T a, T b){ ll ans=1; while(b>0){if(b&1){ans*=a;}a*=a;b>>=1;}return ans;}
template <typename T>
T gcd(T a,T b){ return (b?__gcd(a,b):a); }
template <typename T>
T lcm(T a, T b){ return (a*(b/gcd(a,b))); }
template <typename T>
T cl(T a, T b){ return (a+b-1)/b; }
template <typename T>
T set_bits(T a)
{ return __builtin_popcount(a); }
template <typename T>
T add_self(T& a, T b, T modulus){ a+=b; if(a>=modulus){ a-=modulus; } }
template <typename T>
T to_upper(T s){ transform(s.begin(), s.end(), s.begin(), ::toupper); return s; }
template <typename T>
T to_lower(T s){ transform(s.begin(), s.end(), s.begin(), ::tolower); return s; }

#define rep(i,n) for(int i=0;i<n;i++)

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);
    auto startTime = curTime();

    string s;
    cin>>s;

    int n = sz(s);

    vi sum(n);
    vi pref(n);
    pref[0] = s[0]-'0';
    for(int i=1;i<n;i++)
    {
        pref[i] = pref[i-1] + (s[i]-'0');
    }

    for(int i=n-1;i>=0;i--)
    {
        sum[i] = (s[i]-'0')*i*(i+1)/2;
        if(i>0) sum[i] += (n-i)*pref[i-1];
    }
    //rep(i,n) cout<<sum[i]<<" ";
    //cout<<endl;

    ll ans=0;
    int cnt=0;
    for(int i=n-1;i>=0;i--)
    {
        ans = (ans + (powmod(10,cnt,mod)*sum[i])%mod)%mod;
        cnt++;
    }

    cout<<ans<<endl;

    auto stopTime = curTime();
    auto duration = duration_cast<microseconds>(stopTime - startTime);
    //cout<<"Program ran for "<<(ld)duration.count()/1e6<<" "<<"seconds"<<endl;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
using namespace std::chrono;

#define ll long long
#define ld long double
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(c) ((ll)c.size())
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#ifdef LL
const ll inf = 1e9;
#else
const ll inf = 1e18;
#endif

const int mod = 1e9 + 7;
const int mod2 = 998244353;

typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;

// lower bound returns first element greater than the value

high_resolution_clock::time_point curTime() { return high_resolution_clock::now(); }
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);} //Just add this as a third argument to sort() while sorting an array of pairs; NO NEED FOR ANY ARGUMENTS;
template <typename T>
T fact(T a, T modulus){ int res = 1, i; for (i = 2; i <= a; i++){ res *= i; res%=modulus;} return res; }
template <typename T>
ll powmod(T a,T b,T m){ ll ans=1; while(b>0){if(b&1){ans*=a;ans%=m;}a*=a;a%=m;b>>=1;} return ans; }
template <typename T>
ll power(T a, T b){ ll ans=1; while(b>0){if(b&1){ans*=a;}a*=a;b>>=1;}return ans;}
template <typename T>
T gcd(T a,T b){ return (b?__gcd(a,b):a); }
template <typename T>
T lcm(T a, T b){ return (a*(b/gcd(a,b))); }
template <typename T>
T cl(T a, T b){ return (a+b-1)/b; }
template <typename T>
T set_bits(T a)
{ return __builtin_popcount(a); }
template <typename T>
T add_self(T& a, T b, T modulus){ a+=b; if(a>=modulus){ a-=modulus; } }
template <typename T>
T to_upper(T s){ transform(s.begin(), s.end(), s.begin(), ::toupper); return s; }
template <typename T>
T to_lower(T s){ transform(s.begin(), s.end(), s.begin(), ::tolower); return s; }

#define rep(i,n) for(int i=0;i<n;i++)

ll powmod(ll a, ll b)
{
    ll ans=1;
    while(b)
    {
        if(b&1)
        {
            ans = (ans*a)%mod;
        }
        a = (a*a)%mod;
        b>>=1;
    }
    return ans;
}

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);
    auto startTime = curTime();

    string s;
    cin>>s;

    int n = sz(s);

    vi sum(n);
    vi pref(n);
    pref[0] = s[0]-'0';
    for(int i=1;i<n;i++)
    {
        pref[i] = pref[i-1] + (s[i]-'0');
        pref[i]%=mod;
    }

    for(int i=n-1;i>=0;i--)
    {
        sum[i] = ((s[i]-'0')*(i*(i+1)/2)%mod)%mod;
        if(i>0) sum[i] = (sum[i] + ((n-i)*pref[i-1])%mod)%mod;
        sum[i]%=mod;
    }
    //rep(i,n) cout<<sum[i]<<" ";
    //cout<<endl;

    ll ans=0;
    ll cnt=0;
    for(int i=n-1;i>=0;i--)
    {
        sum[i]%=mod;
        ans = (ans + (powmod((ll)10,cnt)*sum[i])%mod)%mod;
        ans%=mod;
        cnt++;
    }

    cout<<ans<<endl;

    auto stopTime = curTime();
    auto duration = duration_cast<microseconds>(stopTime - startTime);
    //cout<<"Program ran for "<<(ld)duration.count()/1e6<<" "<<"seconds"<<endl;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
using namespace std::chrono;

#define ll long long
#define ld long double
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(c) ((ll)c.size())
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#ifdef LL
const ll inf = 1e9;
#else
const ll inf = 1e18;
#endif

const int mod = 1e9 + 7;
const int mod2 = 998244353;

typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;

// lower bound returns first element greater than the value

high_resolution_clock::time_point curTime() { return high_resolution_clock::now(); }
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);} //Just add this as a third argument to sort() while sorting an array of pairs; NO NEED FOR ANY ARGUMENTS;
template <typename T>
T fact(T a, T modulus){ int res = 1, i; for (i = 2; i <= a; i++){ res *= i; res%=modulus;} return res; }
template <typename T>
ll powmod(T a,T b,T m){ ll ans=1; while(b>0){if(b&1){ans*=a;ans%=m;}a*=a;a%=m;b>>=1;} return ans; }
template <typename T>
ll power(T a, T b){ ll ans=1; while(b>0){if(b&1){ans*=a;}a*=a;b>>=1;}return ans;}
template <typename T>
T gcd(T a,T b){ return (b?__gcd(a,b):a); }
template <typename T>
T lcm(T a, T b){ return (a*(b/gcd(a,b))); }
template <typename T>
T cl(T a, T b){ return (a+b-1)/b; }
template <typename T>
T set_bits(T a)
{ return __builtin_popcount(a); }
template <typename T>
T add_self(T& a, T b, T modulus){ a+=b; if(a>=modulus){ a-=modulus; } }
template <typename T>
T to_upper(T s){ transform(s.begin(), s.end(), s.begin(), ::toupper); return s; }
template <typename T>
T to_lower(T s){ transform(s.begin(), s.end(), s.begin(), ::tolower); return s; }

#define rep(i,n) for(int i=0;i<n;i++)

ll powmod(ll a, ll b)
{
    a%=mod;
    ll ans=1;
    while(b)
    {
        if(b&1)
        {
            ans = (ans*a)%mod;
        }
        a = (a*a)%mod;
        b>>=1;
    }
    return ans;
}

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);
    auto startTime = curTime();

    string s;
    cin>>s;

    ll n = sz(s);

    vi sum(n);
    vi pref(n);
    pref[0] = s[0]-'0';
    for(ll i=1;i<n;i++)
    {
        pref[i] = pref[i-1] + (s[i]-'0');
        pref[i]%=mod;
    }

    for(ll i=n-1;i>=0;i--)
    {
        sum[i] = ((s[i]-'0')*((i*(i+1)/2)%mod))%mod;
        if(i>0) sum[i] = (sum[i] + (((n-i)*pref[i-1])%mod))%mod;
        sum[i]%=mod;
    }
    //rep(i,n) cout<<sum[i]<<" ";
    //cout<<endl;

    ll ans=0;
    ll cnt=0;
    for(ll i=n-1;i>=0;i--)
    {
        sum[i]%=mod;
        ans = (ans + ((powmod((ll)10,cnt)*sum[i])%mod))%mod;
        ans%=mod;
        cnt++;
    }

    cout<<ans<<endl;

    auto stopTime = curTime();
    auto duration = duration_cast<microseconds>(stopTime - startTime);
    //cout<<"Program ran for "<<(ld)duration.count()/1e6<<" "<<"seconds"<<endl;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
using namespace std::chrono;

#define ll long long
#define ld long double
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(c) ((ll)c.size())
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#ifdef LL
const ll inf = 1e9;
#else
const ll inf = 1e18;
#endif

const int mod = 1e9 + 7;
const int mod2 = 998244353;

typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;

// lower bound returns first element greater than the value

high_resolution_clock::time_point curTime() { return high_resolution_clock::now(); }
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);} //Just add this as a third argument to sort() while sorting an array of pairs; NO NEED FOR ANY ARGUMENTS;
template <typename T>
T fact(T a, T modulus){ int res = 1, i; for (i = 2; i <= a; i++){ res *= i; res%=modulus;} return res; }
template <typename T>
ll powmod(T a,T b,ll m){ ll ans=1; while(b>0){if(b&1){ans*=a;ans%=m;}a*=a;a%=m;b>>=1;} return ans; }
template <typename T>
ll power(T a, T b){ ll ans=1; while(b>0){if(b&1){ans*=a;}a*=a;b>>=1;}return ans;}
template <typename T>
T gcd(T a,T b){ return (b?__gcd(a,b):a); }
template <typename T>
T lcm(T a, T b){ return (a*(b/gcd(a,b))); }
template <typename T>
T cl(T a, T b){ return (a+b-1)/b; }
template <typename T>
T set_bits(T a)
{ return __builtin_popcount(a); }
template <typename T>
T add_self(T& a, T b, T modulus){ a+=b; if(a>=modulus){ a-=modulus; } }
template <typename T>
T to_upper(T s){ transform(s.begin(), s.end(), s.begin(), ::toupper); return s; }
template <typename T>
T to_lower(T s){ transform(s.begin(), s.end(), s.begin(), ::tolower); return s; }

#define rep(i,n) for(int i=0;i<n;i++)

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);
    auto startTime = curTime();

    string s;
    cin>>s;

    int n = sz(s);

    vi sum(n);
    vi pref(n);
    pref[0] = s[0]-'0';
    for(int i=1;i<n;i++)
    {
        pref[i] = pref[i-1] + (s[i]-'0');
    }

    for(int i=n-1;i>=0;i--)
    {
        sum[i] = ((s[i]-'0')*i*(i+1)/2)%mod;
        if(i>0) sum[i] = (sum[i] + ((n-i)*pref[i-1])%mod)%mod;
    }
    //rep(i,n) cout<<sum[i]<<" ";
    //cout<<endl;

    ll ans=0;
    int cnt=0;
    for(int i=n-1;i>=0;i--)
    {
        ans = (ans + (powmod(10,cnt,mod)*sum[i])%mod)%mod;
        cnt++;
    }

    cout<<ans<<endl;

    auto stopTime = curTime();
    auto duration = duration_cast<microseconds>(stopTime - startTime);
    //cout<<"Program ran for "<<(ld)duration.count()/1e6<<" "<<"seconds"<<endl;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
using namespace std::chrono;

#define ll long long
#define ld long double
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(c) ((ll)c.size())
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#ifdef LL
const ll inf = 1e9;
#else
const ll inf = 1e18;
#endif

const int mod = 1e9 + 7;
const int mod2 = 998244353;

typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;

// lower bound returns first element greater than the value

high_resolution_clock::time_point curTime() { return high_resolution_clock::now(); }
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);} //Just add this as a third argument to sort() while sorting an array of pairs; NO NEED FOR ANY ARGUMENTS;
template <typename T>
T fact(T a, T modulus){ int res = 1, i; for (i = 2; i <= a; i++){ res *= i; res%=modulus;} return res; }
template <typename T>
ll powmod(T a,T b,ll m){ ll ans=1; while(b>0){if(b&1){ans*=a;ans%=m;}a*=a;a%=m;b>>=1;} return ans; }
template <typename T>
ll power(T a, T b){ ll ans=1; while(b>0){if(b&1){ans*=a;}a*=a;b>>=1;}return ans;}
template <typename T>
T gcd(T a,T b){ return (b?__gcd(a,b):a); }
template <typename T>
T lcm(T a, T b){ return (a*(b/gcd(a,b))); }
template <typename T>
T cl(T a, T b){ return (a+b-1)/b; }
template <typename T>
T set_bits(T a)
{ return __builtin_popcount(a); }
template <typename T>
T add_self(T& a, T b, T modulus){ a+=b; if(a>=modulus){ a-=modulus; } }
template <typename T>
T to_upper(T s){ transform(s.begin(), s.end(), s.begin(), ::toupper); return s; }
template <typename T>
T to_lower(T s){ transform(s.begin(), s.end(), s.begin(), ::tolower); return s; }

#define rep(i,n) for(int i=0;i<n;i++)

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);
    auto startTime = curTime();

    string s;
    cin>>s;

    int n = sz(s);

    vi sum(n);
    vi pref(n);
    pref[0] = s[0]-'0';
    for(int i=1;i<n;i++)
    {
        pref[i] = pref[i-1] + (s[i]-'0');
        pref[i]%=mod;
    }

    for(int i=n-1;i>=0;i--)
    {
        sum[i] = ((s[i]-'0')*i*(i+1)/2)%mod;
        if(i>0) sum[i] = (sum[i] + ((n-i)*pref[i-1])%mod)%mod;
        sum[i]%=mod;
    }
    //rep(i,n) cout<<sum[i]<<" ";
    //cout<<endl;

    ll ans=0;
    ll cnt=0;
    for(int i=n-1;i>=0;i--)
    {
        ans = (ans + (powmod((ll)10,cnt,mod)*sum[i])%mod)%mod;
        ans%=mod;
        cnt++;
    }

    cout<<ans<<endl;

    auto stopTime = curTime();
    auto duration = duration_cast<microseconds>(stopTime - startTime);
    //cout<<"Program ran for "<<(ld)duration.count()/1e6<<" "<<"seconds"<<endl;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
using namespace std::chrono;

#define ll long long
#define ld long double
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(c) ((ll)c.size())
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#ifdef LL
const ll inf = 1e9;
#else
const ll inf = 1e18;
#endif

const int mod = 1e9 + 7;
const int mod2 = 998244353;

typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;

// lower bound returns first element greater than the value

high_resolution_clock::time_point curTime() { return high_resolution_clock::now(); }
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);} //Just add this as a third argument to sort() while sorting an array of pairs; NO NEED FOR ANY ARGUMENTS;
template <typename T>
T fact(T a, T modulus){ int res = 1, i; for (i = 2; i <= a; i++){ res *= i; res%=modulus;} return res; }
template <typename T>
ll powmod(T a,T b,T m){ ll ans=1; while(b>0){if(b&1){ans*=a;ans%=m;}a*=a;a%=m;b>>=1;} return ans; }
template <typename T>
ll power(T a, T b){ ll ans=1; while(b>0){if(b&1){ans*=a;}a*=a;b>>=1;}return ans;}
template <typename T>
T gcd(T a,T b){ return (b?__gcd(a,b):a); }
template <typename T>
T lcm(T a, T b){ return (a*(b/gcd(a,b))); }
template <typename T>
T cl(T a, T b){ return (a+b-1)/b; }
template <typename T>
T set_bits(T a)
{ return __builtin_popcount(a); }
template <typename T>
T add_self(T& a, T b, T modulus){ a+=b; if(a>=modulus){ a-=modulus; } }
template <typename T>
T to_upper(T s){ transform(s.begin(), s.end(), s.begin(), ::toupper); return s; }
template <typename T>
T to_lower(T s){ transform(s.begin(), s.end(), s.begin(), ::tolower); return s; }

#define rep(i,n) for(int i=0;i<n;i++)

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);
    auto startTime = curTime();

    string s;
    cin>>s;

    int n = sz(s);

    vi sum(n);
    vi pref(n);
    pref[0] = s[0]-'0';
    for(int i=1;i<n;i++)
    {
        pref[i] = pref[i-1] + (s[i]-'0');
        pref[i]%=mod;
    }

    for(int i=n-1;i>=0;i--)
    {
        sum[i] = ((s[i]-'0')*(i*(i+1)/2)%mod)%mod;
        if(i>0) sum[i] = (sum[i] + ((n-i)*pref[i-1])%mod)%mod;
        sum[i]%=mod;
    }
    //rep(i,n) cout<<sum[i]<<" ";
    //cout<<endl;

    ll ans=0;
    ll cnt=0;
    for(int i=n-1;i>=0;i--)
    {
        sum[i]%=mod;
        ans = (ans + (powmod((ll)10,cnt,(ll)mod)*sum[i])%mod)%mod;
        ans%=mod;
        cnt++;
    }

    cout<<ans<<endl;

    auto stopTime = curTime();
    auto duration = duration_cast<microseconds>(stopTime - startTime);
    //cout<<"Program ran for "<<(ld)duration.count()/1e6<<" "<<"seconds"<<endl;
}


// kid_kb //

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ull unsigned long long int
#define lower(str) transform(str.begin(),str.end(),str.begin(),::tolower);
#define upper(str) transform(str.begin(),str.end(),str.begin(),::toupper);
#define mod 1000000007
#define SORT(vec) sort(vec.begin(),vec.end());
#define pb push_back
#define csb __builtin_popcount
#define msb(n) (ll)(log2(n))
#define DIG(n) floor(log10(n))+1
#define kb ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ptr(arr) for(auto i:arr)cout<<i<<" ";
#define ptr2(vec) for(auto i:vec){for(auto j: i){cout<<j<<" ";}cout<<endl;}
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,n,a) for (int i=n-1;i>=a;i--)
#define mem(a,val) memset(a,val,sizeof(a))
#define INF INT_MAX
#define inf INT_MIN

// cout<<fixed<<setprecision(8)<<endl;

ll gcd(ll a,ll b)
{    if (a == 0)    return b;     return gcd(b % a, a); }

ll lcm(ll a,ll b)
{    ll g=gcd(a,b); ll ans=(a*b)/g; return ans;    }

ll fastpower(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=fastpower(a,b/2,m); t=(t*t)%m; if(b&1)t=(t*a)%m; return t;}

ll modInverse(ll a, ll m) { return fastpower(a, m-2, m); }

//----------------------------------------Let's Fight-----------------------------------------------------------------

void solve(){
    string s;
    cin>>s;

    ll n=s.length();
    if(n==1){cout<<0<<endl;return ;}
    ll arr[n];
    ll arr2[n];
    for(int i=0;i<n;i++){
        int dig=s[i]-'0';
       if(i!=0){
           arr2[i]=((arr2[i-1]*10)%mod+dig)%mod;
       }
       else arr2[i]=dig;
    }

    for(ll i=n-1;i>=0;i--){
        int dig=s[i]-'0';
        if(i!=n-1){
            arr[i]=((dig*(ll)pow(10,n-i-1)%mod)%mod+arr[i+1])%mod;
        }
        else arr[i]=dig;
    }
    ll sum[n];
    sum[n-1]=arr[n-1];
    for(int i=n-2;i>=0;i--){
        sum[i]=(sum[i+1]+arr[i])%mod;
    }
    ll ans=0;

    //ptr(sum)
    //cout<<endl;
    //ptr(arr2)
    rep(i,0,n){
        if(i==0){
            ans=sum[1];
            ans%=mod;
        }
        else if(i==n-1){
            ans+=arr2[i-1];
            ans%=mod;
        }
        else{
            ans+=sum[i+1];
            ans%=mod;

            ll sum1=(fastpower(10,n-i,mod)-1)/9;
            ll sum2=(arr2[i-1]*sum1)%mod;
            ans+=sum2;
            ans%=mod;
        }
       // cout<<ans<<endl;
    }
    cout<<ans<<endl;
}

int main()
{
    kb
//  clock_t tStart = clock();
    ll t;
     t=1;
//    cin>>t;
    while(t--){
        solve();
    }
//  printf("%.2fs time lga\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
    return 0;
}


// kid_kb //

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ull unsigned long long int
#define lower(str) transform(str.begin(),str.end(),str.begin(),::tolower);
#define upper(str) transform(str.begin(),str.end(),str.begin(),::toupper);
#define mod 1000000007
#define SORT(vec) sort(vec.begin(),vec.end());
#define pb push_back
#define csb __builtin_popcount
#define msb(n) (ll)(log2(n))
#define DIG(n) floor(log10(n))+1
#define kb ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ptr(arr) for(auto i:arr)cout<<i<<" ";
#define ptr2(vec) for(auto i:vec){for(auto j: i){cout<<j<<" ";}cout<<endl;}
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,n,a) for (int i=n-1;i>=a;i--)
#define mem(a,val) memset(a,val,sizeof(a))
#define INF INT_MAX
#define inf INT_MIN

// cout<<fixed<<setprecision(8)<<endl;

ll gcd(ll a,ll b)
{    if (a == 0)    return b;     return gcd(b % a, a); }

ll lcm(ll a,ll b)
{    ll g=gcd(a,b); ll ans=(a*b)/g; return ans;    }

ll fastpower(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=fastpower(a,b/2,m); t=(t*t)%m; if(b&1)t=(t*a)%m; return t;}

ll modInverse(ll a, ll m) { return fastpower(a, m-2, m); }

//----------------------------------------Let's Fight-----------------------------------------------------------------

void solve(){
    string s;
    cin>>s;

    ll n=s.length();
    if(n==1){cout<<0<<endl;return ;}

    ll arr[n];
    ll arr2[n];
    ll ten=10;
    for(int i=0;i<n;i++){
       ll dig=s[i]-'0';
       if(i!=0){
           arr2[i]=((arr2[i-1]*ten)%mod+dig)%mod;
       }
       else arr2[i]=dig;
    }

    for(ll i=n-1;i>=0;i--){
        ll dig=s[i]-'0';
        if(i!=n-1){
            arr[i]=((dig*fastpower(10,n-i-1,mod))%mod+arr[i+1])%mod;
        }
        else arr[i]=dig;
    }

    ll sum[n];
    sum[n-1]=arr[n-1]%mod;

    for(ll i=n-2;i>=0;i--){
        sum[i]=(sum[i+1]+arr[i])%mod;
    }

    ll ans=0;

    ll nine=9;
    rep(i,0,n){
        if(i==0){
            ans=sum[1];
            ans%=mod;
        }
        else if(i==n-1){
            ans+=arr2[i-1];
            ans%=mod;
        }
        else{
            ans+=sum[i+1];
            ans%=mod;

            ll sum1=(((fastpower(10,n-i,mod)-1+mod)%mod)*modInverse(9,mod)+mod)%mod;
            ll sum2=(arr2[i-1]*sum1)%mod;
            ans+=sum2;
            ans%=mod;
        }
    }
    cout<<ans<<endl;
}

int main()
{
    kb
//  clock_t tStart = clock();
    ll t;
     t=1;
//    cin>>t;
    while(t--){
        solve();
    }
//  printf("%.2fs time lga\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
    return 0;
}


// kid_kb //

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ull unsigned long long int
#define lower(str) transform(str.begin(),str.end(),str.begin(),::tolower);
#define upper(str) transform(str.begin(),str.end(),str.begin(),::toupper);
#define mod 1000000007
#define SORT(vec) sort(vec.begin(),vec.end());
#define pb push_back
#define csb __builtin_popcount
#define msb(n) (ll)(log2(n))
#define DIG(n) floor(log10(n))+1
#define kb ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ptr(arr) for(auto i:arr)cout<<i<<" ";
#define ptr2(vec) for(auto i:vec){for(auto j: i){cout<<j<<" ";}cout<<endl;}
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,n,a) for (int i=n-1;i>=a;i--)
#define mem(a,val) memset(a,val,sizeof(a))
#define INF INT_MAX
#define inf INT_MIN

// cout<<fixed<<setprecision(8)<<endl;

ll gcd(ll a,ll b)
{    if (a == 0)    return b;     return gcd(b % a, a); }

ll lcm(ll a,ll b)
{    ll g=gcd(a,b); ll ans=(a*b)/g; return ans;    }

ll fastpower(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=fastpower(a,b/2,m); t=(t*t)%m; if(b&1)t=(t*a)%m; return t;}

ll modInverse(ll a, ll m) { return fastpower(a, m-2, m); }

//----------------------------------------Let's Fight-----------------------------------------------------------------

void solve(){
    string s;
    cin>>s;

    ll n=s.length();
    if(n==1){cout<<0<<endl;return ;}

    ll arr[n];
    ll arr2[n];

    for(int i=0;i<n;i++){
        ll dig=s[i]-'0';
       if(i!=0){
           arr2[i]=((arr2[i-1]*10)%mod+dig)%mod;
       }
       else arr2[i]=dig;
    }

    for(ll i=n-1;i>=0;i--){
        ll dig=s[i]-'0';
        if(i!=n-1){
            arr[i]=((dig*fastpower(10,n-i-1,mod))%mod+arr[i+1])%mod;
        }
        else arr[i]=dig;
    }

    ll sum[n];
    sum[n-1]=arr[n-1];
    for(ll i=n-2;i>=0;i--){
        sum[i]=(sum[i+1]+arr[i])%mod;
    }
    ll ans=0;

    ll nine=9;
    rep(i,0,n){
        if(i==0){
            ans=sum[1];
            ans%=mod;
        }
        else if(i==n-1){
            ans+=arr2[i-1];
            ans%=mod;
        }
        else{
            ans+=sum[i+1];
            ans%=mod;

            ll sum1=(fastpower(10,n-i,mod)-1)/nine;
            ll sum2=(arr2[i-1]*sum1)%mod;
            ans+=sum2;
            ans%=mod;
        }
       // cout<<ans<<endl;
    }
    cout<<ans<<endl;
}

int main()
{
    kb
//  clock_t tStart = clock();
    ll t;
     t=1;
//    cin>>t;
    while(t--){
        solve();
    }
//  printf("%.2fs time lga\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
    return 0;
}


// kid_kb //

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ull unsigned long long int
#define lower(str) transform(str.begin(),str.end(),str.begin(),::tolower);
#define upper(str) transform(str.begin(),str.end(),str.begin(),::toupper);
#define mod 1000000007
#define SORT(vec) sort(vec.begin(),vec.end());
#define pb push_back
#define csb __builtin_popcount
#define msb(n) (ll)(log2(n))
#define DIG(n) floor(log10(n))+1
#define kb ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ptr(arr) for(auto i:arr)cout<<i<<" ";
#define ptr2(vec) for(auto i:vec){for(auto j: i){cout<<j<<" ";}cout<<endl;}
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,n,a) for (int i=n-1;i>=a;i--)
#define mem(a,val) memset(a,val,sizeof(a))
#define INF INT_MAX
#define inf INT_MIN

// cout<<fixed<<setprecision(8)<<endl;

ll gcd(ll a,ll b)
{    if (a == 0)    return b;     return gcd(b % a, a); }

ll lcm(ll a,ll b)
{    ll g=gcd(a,b); ll ans=(a*b)/g; return ans;    }

ll fastpower(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=fastpower(a,b/2,m); t=(t*t)%m; if(b&1)t=(t*a)%m; return t;}

ll modInverse(ll a, ll m) { return fastpower(a, m-2, m); }

//----------------------------------------Let's Fight-----------------------------------------------------------------

void solve(){
    string s;
    cin>>s;

    ll n=s.length();
    if(n==1){cout<<0<<endl;return ;}

    ll arr[n];
    ll arr2[n];

    for(int i=0;i<n;i++){
        int dig=s[i]-'0';
       if(i!=0){
           arr2[i]=((arr2[i-1]*10)%mod+dig)%mod;
       }
       else arr2[i]=dig;
    }

    for(ll i=n-1;i>=0;i--){
        int dig=s[i]-'0';
        if(i!=n-1){
            arr[i]=((dig*fastpower(10,n-i-1,mod))%mod+arr[i+1])%mod;
        }
        else arr[i]=dig;
    }

    ll sum[n];
    sum[n-1]=arr[n-1];
    for(ll i=n-2;i>=0;i--){
        sum[i]=(sum[i+1]+arr[i])%mod;
    }
    ll ans=0;

    //ptr(sum)
    //cout<<endl;
    //ptr(arr2)
    rep(i,0,n){
        if(i==0){
            ans=sum[1];
            ans%=mod;
        }
        else if(i==n-1){
            ans+=arr2[i-1];
            ans%=mod;
        }
        else{
            ans+=sum[i+1];
            ans%=mod;

            ll sum1=(fastpower(10,n-i,mod)-1)/9;
            ll sum2=(arr2[i-1]*sum1)%mod;
            ans+=sum2;
            ans%=mod;
        }
       // cout<<ans<<endl;
    }
    cout<<ans<<endl;
}

int main()
{
    kb
//  clock_t tStart = clock();
    ll t;
     t=1;
//    cin>>t;
    while(t--){
        solve();
    }
//  printf("%.2fs time lga\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
    return 0;
}


// kid_kb //

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ull unsigned long long int
#define lower(str) transform(str.begin(),str.end(),str.begin(),::tolower);
#define upper(str) transform(str.begin(),str.end(),str.begin(),::toupper);
#define mod 1000000007
#define SORT(vec) sort(vec.begin(),vec.end());
#define pb push_back
#define csb __builtin_popcount
#define msb(n) (ll)(log2(n))
#define DIG(n) floor(log10(n))+1
#define kb ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ptr(arr) for(auto i:arr)cout<<i<<" ";
#define ptr2(vec) for(auto i:vec){for(auto j: i){cout<<j<<" ";}cout<<endl;}
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,n,a) for (int i=n-1;i>=a;i--)
#define mem(a,val) memset(a,val,sizeof(a))
#define INF INT_MAX
#define inf INT_MIN

// cout<<fixed<<setprecision(8)<<endl;

ll gcd(ll a,ll b)
{    if (a == 0)    return b;     return gcd(b % a, a); }

ll lcm(ll a,ll b)
{    ll g=gcd(a,b); ll ans=(a*b)/g; return ans;    }

ll fastpower(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=fastpower(a,b/2,m); t=(t*t)%m; if(b&1)t=(t*a)%m; return t;}

ll modInverse(ll a, ll m) { return fastpower(a, m-2, m); }

//----------------------------------------Let's Fight-----------------------------------------------------------------

void solve(){
    string s;
    cin>>s;

    ll n=s.length();
    ll arr[n];
    ll arr2[n];
    for(int i=0;i<n;i++){
        int dig=s[i]-'0';
       if(i!=0){
           arr2[i]=((arr2[i-1]*10)%mod+dig)%mod;
       }
       else arr2[i]=dig;
    }
    for(ll i=n-1;i>=0;i--){
        int dig=s[i]-'0';
        if(i!=n-1){
            arr[i]=((dig*(ll)pow(10,n-i-1))%mod+arr[i+1])%mod;
        }
        else arr[i]=dig;
    }
    ll sum[n];
    sum[n-1]=arr[n-1];
    for(int i=n-2;i>=0;i--){
        sum[i]=(sum[i+1]+arr[i])%mod;
    }
    ll ans=0;

    //ptr(sum)
    //cout<<endl;
    //ptr(arr2)
    rep(i,0,n){
        if(i==0){
            ans=sum[1];
            ans%=mod;
        }
        else if(i==n-1){
            ans+=arr2[i-1];
            ans%=mod;
        }
        else{
            ans+=sum[i+1];
            ans%=mod;

            ll sum1=(fastpower(10,n-i,mod)-1)/9;
            ll sum2=(arr2[i-1]*sum1)%mod;
            ans+=sum2;
            ans%=mod;
        }
       // cout<<ans<<endl;
    }
    cout<<ans<<endl;
}

int main()
{
    kb
//  clock_t tStart = clock();
    ll t;
     t=1;
//    cin>>t;
    while(t--){
        solve();
    }
//  printf("%.2fs time lga\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
    return 0;
}


// kid_kb //

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ull unsigned long long int
#define lower(str) transform(str.begin(),str.end(),str.begin(),::tolower);
#define upper(str) transform(str.begin(),str.end(),str.begin(),::toupper);
#define mod 1000000007
#define SORT(vec) sort(vec.begin(),vec.end());
#define pb push_back
#define csb __builtin_popcount
#define msb(n) (ll)(log2(n))
#define DIG(n) floor(log10(n))+1
#define kb ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ptr(arr) for(auto i:arr)cout<<i<<" ";
#define ptr2(vec) for(auto i:vec){for(auto j: i){cout<<j<<" ";}cout<<endl;}
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,n,a) for (int i=n-1;i>=a;i--)
#define mem(a,val) memset(a,val,sizeof(a))
#define INF INT_MAX
#define inf INT_MIN

// cout<<fixed<<setprecision(8)<<endl;

ll gcd(ll a,ll b)
{    if (a == 0)    return b;     return gcd(b % a, a); }

ll lcm(ll a,ll b)
{    ll g=gcd(a,b); ll ans=(a*b)/g; return ans;    }

ll fastpower(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=fastpower(a,b/2,m); t=(t*t)%m; if(b&1)t=(t*a)%m; return t;}

ll modInverse(ll a, ll m) { return fastpower(a, m-2, m); }

//----------------------------------------Let's Fight-----------------------------------------------------------------

void solve(){
    string s;
    cin>>s;

    ll n=s.length();
    if(n==1){cout<<0<<endl;return ;}

    ll arr[n];
    ll arr2[n];
    ll ten=10;
    for(int i=0;i<n;i++){
       ll dig=s[i]-'0';
       if(i!=0){
           arr2[i]=((arr2[i-1]*ten)%mod+dig)%mod;
       }
       else arr2[i]=dig;
    }

    for(ll i=n-1;i>=0;i--){
        ll dig=s[i]-'0';
        if(i!=n-1){
            arr[i]=((dig*fastpower(10,n-i-1,mod))%mod+arr[i+1])%mod;
        }
        else arr[i]=dig;
    }

    ll sum[n];
    sum[n-1]=arr[n-1]%mod;

    for(ll i=n-2;i>=0;i--){
        sum[i]=(sum[i+1]+arr[i])%mod;
    }

    ll ans=0;

    ll nine=9;
    rep(i,0,n){
        if(i==0){
            ans=sum[1];
            ans%=mod;
        }
        else if(i==n-1){
            ans+=arr2[i-1];
            ans%=mod;
        }
        else{
            ans+=sum[i+1];
            ans%=mod;

            ll sum1=(fastpower(10,n-i,mod)-1)/nine;
            ll sum2=(arr2[i-1]*sum1)%mod;
            ans+=sum2;
            ans%=mod;
        }
    }
    cout<<ans<<endl;
}

int main()
{
    kb
//  clock_t tStart = clock();
    ll t;
     t=1;
//    cin>>t;
    while(t--){
        solve();
    }
//  printf("%.2fs time lga\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
    return 0;
}


// kid_kb //

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ull unsigned long long int
#define lower(str) transform(str.begin(),str.end(),str.begin(),::tolower);
#define upper(str) transform(str.begin(),str.end(),str.begin(),::toupper);
#define mod 1000000007
#define SORT(vec) sort(vec.begin(),vec.end());
#define pb push_back
#define csb __builtin_popcount
#define msb(n) (ll)(log2(n))
#define DIG(n) floor(log10(n))+1
#define kb ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ptr(arr) for(auto i:arr)cout<<i<<" ";
#define ptr2(vec) for(auto i:vec){for(auto j: i){cout<<j<<" ";}cout<<endl;}
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,n,a) for (int i=n-1;i>=a;i--)
#define mem(a,val) memset(a,val,sizeof(a))
#define INF INT_MAX
#define inf INT_MIN

// cout<<fixed<<setprecision(8)<<endl;

ll gcd(ll a,ll b)
{    if (a == 0)    return b;     return gcd(b % a, a); }

ll lcm(ll a,ll b)
{    ll g=gcd(a,b); ll ans=(a*b)/g; return ans;    }

//ll fastpower(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=fastpower(a,b/2,m); t=(t*t)%m; if(b&1)t=(t*a)%m; return t;}
ll fastpower(ll n,ll p,ll m)
{
   if(p==0)
       return 1;
    ll t=fastpower(n, p/2, m);
    ll ans= ((t%m)*(t%m))%m;

    if(p%2!=0)
    {
        ans=((ans%m)* (n%m) )%m;
    }
    return ans;
}

ll modInverse(ll a, ll m) { return fastpower(a, m-2, m); }

//----------------------------------------Let's Fight-----------------------------------------------------------------

void solve(){
    string s;
    cin>>s;

    ll n=s.length();
    if(n==1){cout<<0<<endl;return ;}

    ll arr[n];
    ll arr2[n];

    for(int i=0;i<n;i++){
       ll dig=s[i]-'0';
       if(i!=0){
           arr2[i]=((arr2[i-1]*10)%mod+dig)%mod;
       }
       else arr2[i]=dig;
    }

    for(ll i=n-1;i>=0;i--){
        ll dig=s[i]-'0';
        if(i!=n-1){
            arr[i]=((dig*fastpower(10,n-i-1,mod))%mod+arr[i+1])%mod;
        }
        else arr[i]=dig;
    }

    ll sum[n];
    sum[n-1]=arr[n-1];
    for(ll i=n-2;i>=0;i--){
        sum[i]=(sum[i+1]+arr[i])%mod;
    }
    ll ans=0;

    ll nine=9;
    rep(i,0,n){
        if(i==0){
            ans=sum[1];
            ans%=mod;
        }
        else if(i==n-1){
            ans+=arr2[i-1];
            ans%=mod;
        }
        else{
            ans+=sum[i+1];
            ans%=mod;

            ll sum1=(fastpower(10,n-i,mod)-1)/nine;
            ll sum2=(arr2[i-1]*sum1)%mod;
            ans+=sum2;
            ans%=mod;
        }
    }
    cout<<ans<<endl;
}

int main()
{
    kb
//  clock_t tStart = clock();
    ll t;
     t=1;
//    cin>>t;
    while(t--){
        solve();
    }
//  printf("%.2fs time lga\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
    return 0;
}


#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define up upper_bound
#define lb lower_bound
#define ff first
#define ss second
#define ll long long
#define vi vector < ll >
#define pi pair < ll , ll >
#define ld long double
#define iPair pair< ll , ll >
using namespace std;
#define lp(n,i) for(ll i=0;i<n;i++)
#define rlp(n) for(ll i=n-1;i>=0;i--)
//#define e 1000000009
//#define e  998244353
#define inf 9999999999999999
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define fill0(ar) fill((ar), 0)
#define e 1000000007
#define pri2 1000001001
#define PI 3.14159265
 /*
ll pw(ll a, ll b)
{
    ll t=1;

    if(b==0)return t;
    if(b%2)
    {
        t=t*a;
    }
   t%=e;
    ll x=pw(a,b/2);
    x=x*x;
    x%=e;
    t*=x;
    t%=e;
    return t;
}/*
vector < ll > pr;
ll vis[10000005]={0};
void seive ( ll n)
{
    for(ll i=2;i*i<=n;i++)
    {
        if(vis[i]==0)
        {

            for(ll j=i*i;j<=n;j+=i)vis[j]=1;
        }
    }

    for(ll i=2;i<=n;i++)
    {
        if(vis[i]==0)pr.pb(i);
    }
}

#define N 100005
ll z[N];
vector < ll > v;
void getz(string s)
{
    ll n=s.length();
    ll l=0,r=0;
    for(ll i=1;i<n;i++)
    {
        if(i<=r)
        {
            z[i]=min(r-i+1,z[i-l]);
        }

        while(i+z[i]<n&&s[z[i]]==s[i+z[i]])z[i]++;

        if((i+z[i]-1)>r)
        {
            l=i;
            r=i+z[i]-1;
        }
    }

   for(ll i=0;i<n;i++)
   {
       v.pb(z[i]);
   }

    sort(v.begin(),v.end());

}
*/

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 ll ti=1;
//cin>>ti;

 for (ll io=0;io<ti;io++)
 {
string s;

cin>>s;
ll n=s.length();

ll p[n+5];
p[0]=1;
ll tn=10;
for(ll i=1;i<n+5;i++)p[i]=(p[i-1]*tn)%e;
ll ans=0;
ll pr[n+4];
pr[0]=0;
for(int i=0;i<n;i++)
{
    ll m=s[i]-'0';
    int z=(i*(i+1))/2;
    ans+=(m*((z*p[n-i-1])%e))%e;

    pr[i+1]=pr[i]+m;
}
for(ll i=n-2;i>=0;i--)
{
  ans+=(((pr[n-1-i]*p[i])%e)*(i+1))%e;

}

ans+=e;
ans%=e;
 cout<<ans<<endl;

}

 return 0;
}


#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define up upper_bound
#define lb lower_bound
#define ff first
#define ss second
#define ll long long
#define vi vector < ll >
#define pi pair < ll , ll >
#define ld long double
#define iPair pair< ll , ll >
using namespace std;
#define lp(n,i) for(ll i=0;i<n;i++)
#define rlp(n) for(ll i=n-1;i>=0;i--)
//#define e 1000000009
//#define e  998244353
#define inf 9999999999999999
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define fill0(ar) fill((ar), 0)
#define e 1000000007
#define pri2 1000001001
#define PI 3.14159265
 /*
ll pw(ll a, ll b)
{
    ll t=1;

    if(b==0)return t;
    if(b%2)
    {
        t=t*a;
    }
   t%=e;
    ll x=pw(a,b/2);
    x=x*x;
    x%=e;
    t*=x;
    t%=e;
    return t;
}/*
vector < ll > pr;
ll vis[10000005]={0};
void seive ( ll n)
{
    for(ll i=2;i*i<=n;i++)
    {
        if(vis[i]==0)
        {

            for(ll j=i*i;j<=n;j+=i)vis[j]=1;
        }
    }

    for(ll i=2;i<=n;i++)
    {
        if(vis[i]==0)pr.pb(i);
    }
}

#define N 100005
ll z[N];
vector < ll > v;
void getz(string s)
{
    ll n=s.length();
    ll l=0,r=0;
    for(ll i=1;i<n;i++)
    {
        if(i<=r)
        {
            z[i]=min(r-i+1,z[i-l]);
        }

        while(i+z[i]<n&&s[z[i]]==s[i+z[i]])z[i]++;

        if((i+z[i]-1)>r)
        {
            l=i;
            r=i+z[i]-1;
        }
    }

   for(ll i=0;i<n;i++)
   {
       v.pb(z[i]);
   }

    sort(v.begin(),v.end());

}
*/

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 ll ti=1;
//cin>>ti;

 for (ll io=0;io<ti;io++)
 {
string s;

cin>>s;
ll n=s.length();

ll p[n+5];
p[0]=1;
ll tn=10;
for(ll i=1;i<n+5;i++)p[i]=(p[i-1]*tn)%e;
ll ans=0;
ll pr[n+4];
pr[0]=0;
for(int i=0;i<n;i++)
{
    ll m=s[i]-'0';
    ll z=(i*(i+1))/2;
    z=z%e;
    ans+=(m*((z*p[n-i-1])%e))%e;
    ans%=e;

    pr[i+1]=pr[i]+m;
    pr[i+1]%=e;
}
for(ll i=n-2;i>=0;i--)
{
  ans+=(((pr[n-1-i]*p[i])%e)*(i+1))%e;
  ans%=e;

}

ans+=e;
ans%=e;
 cout<<ans<<endl;

}

 return 0;
}