#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<utility>
using namespace std;
int main(){
    int t{0};
    cin>>t;
    while(t--){
        int n{0};
        cin>>n;
        vector<pair<long long int,int>> vec(n);
        for(int i=0;i<n;i++){
            cin>>vec[i].first;
            vec[i].second=i;
        }
        int a{-1},b{-1};
        int v=0;
        sort(vec.begin(),vec.end());
        for(int i=1;i<n;i++){
            if(vec[i].first==vec[v].first)
            v++;
        }
        for(int i=n-1;i>0;i--){
            int z=vec[i].second-vec[v].second;
            if(z<0)
            z=-z;
            z++;
            if(vec[i].first-vec[v].first>=z){
                a=vec[i].second;
                b=vec[v].second;
                break;
            }
        }
        if(a<b){
            int x=a;
            a=b;
            b=x;
        }
        if(a==-1 && b==-1){
            cout<<"NO"<<endl;
        }else{
            cout<<"YES"<<endl;
            cout<<b+1<<" "<<a+1<<endl;
        }
    }

    return 0;
}


#include<iostream>
#include<algorithm>
#include<numeric>
#include<vector>
#include<utility>
using namespace std;
int main(){
    int t{0};
    cin>>t;
    while(t--){
        int n{0};
        cin>>n;
        vector<long long int> vec(n);
        int a=-1,b=-1;
        for(int i=0;i<n;i++){
            cin>>vec[i];
        }
        for(int i=1;i<n;i++){
            if(vec[i]-vec[i-1]>=2){
                a=i-1;
                b=i;
                break;
            }
        }
        if(a==-1 && b==-1){
            cout<<"NO"<<endl;
        }else{
            cout<<"YES"<<endl;
             cout<<a+1<<" "<<b+1<<endl;
        }
      //  cout<<a<<" "<<b<<endl;
    }

    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<utility>
using namespace std;
int main(){
    int t{0};
    cin>>t;
    while(t--){
        int n{0};
        cin>>n;
        vector<pair<long long int,int>> vec(n);
        for(int i=0;i<n;i++){
            cin>>vec[i].first;
            vec[i].second=i;
        }
        int a{0},b{0};
        sort(vec.begin(),vec.end());
        for(int i=n-1;i>0;i--){
            int z=vec[i].second-vec[0].second;
            if(z<0)
            z=-z;
            z++;
            if(vec[i].first-vec[0].first>=z){
                a=vec[i].second;
                b=vec[0].second;
                break;
            }
        }
        if(a<b){
            int x=a;
            a=b;
            b=a;
        }
        if(a==0 && b==0){
            cout<<"NO"<<endl;
        }else{
            cout<<"YES"<<endl;
            cout<<b<<" "<<a<<endl;
        }
    }

    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<utility>
using namespace std;
int main(){
    int t{0};
    cin>>t;
    while(t--){
        int n{0};
        cin>>n;
        vector<pair<long long int,int>> vec(n);
        for(int i=0;i<n;i++){
            cin>>vec[i].first;
            vec[i].second=i;
        }
        int a{-1},b{-1};
        bool flag=false;
        sort(vec.begin(),vec.end());
        for(int j=0;j<n-1;j++){
            if(j!=0 && vec[j]==vec[j-1])
            continue;
        for(int i=n-1;i>j;i--){
            int z=vec[i].second-vec[j].second;
            if(z<0)
            z=-z;
            z++;
            if(vec[i].first-vec[j].first>=z){
                a=vec[i].second;
                b=vec[j].second;
                flag=true;
                break;
            }
        }
            if(flag)
            break;
        }
        if(a<b){
            int x=a;
            a=b;
            b=x;
        }
        if(a==-1 && b==-1){
            cout<<"NO"<<endl;
        }else{
            cout<<"YES"<<endl;
            cout<<b+1<<" "<<a+1<<endl;
        }
    }

    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<utility>
using namespace std;
int main(){
    int t{0};
    cin>>t;
    while(t--){
        int n{0};
        cin>>n;
        vector<pair<long long int,int>> vec(n);
        for(int i=0;i<n;i++){
            cin>>vec[i].first;
            vec[i].second=i;
        }
        int a{0},b{0};
        sort(vec.begin(),vec.end());
        for(int i=n-1;i>0;i--){
            int z=vec[i].second-vec[0].second;
            if(z<0)
            z=-z;
            z++;
            if(vec[i].first-vec[0].first>=z){
                a=vec[i].second;
                b=vec[0].second;
                break;
            }
        }
        if(a<b){
            int x=a;
            a=b;
            b=x;
        }
        if(a==0 && b==0){
            cout<<"NO"<<endl;
        }else{
            cout<<"YES"<<endl;
            cout<<b+1<<" "<<a+1<<endl;
        }
    }

    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<utility>
using namespace std;
int main(){
    int t{0};
    cin>>t;
    while(t--){
        int n{0};
        cin>>n;
        vector<pair<long long int,int>> vec(n);
        for(int i=0;i<n;i++){
            cin>>vec[i].first;
            vec[i].second=i;
        }
        int a{0},b{0};
        sort(vec.begin(),vec.end());
        for(int i=n-1;i>0;i--){
            int z=vec[i].second-vec[0].second;
            if(z<0)
            z=-z;
            z++;
            if(vec[i].first-vec[0].first>=z){
                a=vec[i].second;
                b=vec[0].second;
                break;
            }
        }
        if(a<b){
            int x=a;
            a=b;
            b=a;
        }
        if(a==0 && b==0){
            cout<<"NO"<<endl;
        }else{
            cout<<"YES"<<endl;
            cout<<b+1<<" "<<a+1<<endl;
        }
    }

    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<utility>
using namespace std;
int main(){
    int t{0};
    cin>>t;
    while(t--){
        int n{0};
        cin>>n;
        vector<pair<long long int,int>> vec(n);
        for(int i=0;i<n;i++){
            cin>>vec[i].first;
            vec[i].second=i;
        }
        int a{-1},b{-1};
        bool flag=false;
        sort(vec.begin(),vec.end());
        for(int j=0;j<n-1;j++){
        for(int i=n-1;i>j;i--){
            int z=vec[i].second-vec[j].second;
            if(z<0)
            z=-z;
            z++;
            if(vec[i].first-vec[j].first>=z){
                a=vec[i].second;
                b=vec[j].second;
                flag=true;
                break;
            }
        }
            if(flag)
            break;
        }
        if(a<b){
            int x=a;
            a=b;
            b=x;
        }
        if(a==-1 && b==-1){
            cout<<"NO"<<endl;
        }else{
            cout<<"YES"<<endl;
            cout<<b+1<<" "<<a+1<<endl;
        }
    }

    return 0;
}


#include<iostream>
#include<algorithm>
#include<numeric>
#include<vector>
#include<utility>
using namespace std;
int main(){
    int t{0};
    cin>>t;
    while(t--){
        int n{0};
        cin>>n;
        vector<long long int> vec(n);
        int a=-1,b=-1;
        for(int i=0;i<n;i++){
            cin>>vec[i];
        }
        for(int i=1;i<n;i++){
            if(vec[i]-vec[i-1]>=2){
                a=i-1;
                b=i;
                break;
            }
        }
        cout<<a<<" "<<b<<endl;
    }

    return 0;
}


    #include <bits/stdc++.h>

    using namespace std;

    map<int,int>x,y,tmx,tmn;

    void build(int v,int l,int r){
        if(l==r){tmx[v]=x[l];tmn[v]=y[l];return;}
        int m=(l+r)/2;
        build(2*v,l,m);
        build(2*v+1,m+1,r);
        tmx[v]=max(tmx[2*v],tmx[2*v+1]);
        tmn[v]=min(tmn[2*v],tmn[2*v+1]);
    }

    int main() {
        //freopen("i.txt","r",stdin);
        ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
        int t;cin>>t;
        while(t--){
            int n,sz;
            cin>>n;

            for(int i=0;i<n;i++){cin>>x[i];y[i]=x[i];}
            sz = 1 << int(ceil(log2(n)));

            for(int i=n;i<=sz;i++){
                x[i]=INT_MIN;
                y[i]=INT_MAX;
            }

            build(1,0,sz-1);

            for(int i=1;i<sz;i++){
                if(tmn[i]==INT_MAX||tmx[i]==INT_MIN)continue;

                //cout<<tmn[i]<<" "<<tmx[i]<<endl;
                int I=i,c=0;
                while(I<sz){
                    I*=2;c++;
                }

                if(tmx[i]-tmn[i]>=pow(2,c)){
                    int l=i,r=i;
                    while(l<sz)l*=2;
                    while(r<sz){r*=2;r++;}
                    cout<<"YES\n"<<l-sz+1<<" "<<r-sz+1<<endl;
                    goto e;
                }

            }
            cout<<"NO\n";
            e:
            x.clear();tmn.clear();tmx.clear();
        }
    }


#include <bits/stdc++.h>

using namespace std;

map<int,int>x,y,tmx,tmn;

void build(int v,int l,int r){
    if(l==r){tmx[v]=x[l];tmn[v]=y[l];return;}
    int m=(l+r)/2;
    build(2*v,l,m);
    build(2*v+1,m+1,r);
    tmx[v]=max(tmx[2*v],tmx[2*v+1]);
    tmn[v]=min(tmn[2*v],tmn[2*v+1]);
}

int main() {
    //freopen("i.txt","r",stdin);
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t;cin>>t;
    while(t--){
        int n,sz;
        cin>>n;

        for(int i=0;i<n;i++){cin>>x[i];y[i]=x[i];}
        sz = 1 << int(ceil(log2(n)));

        for(int i=n;i<=sz;i++){
            x[i]=INT_MIN;
            y[i]=INT_MAX;
        }

        build(1,0,sz-1);

        for(int i=1;i<sz;i++){
            if(tmn[i]==INT_MAX||tmx[i]==INT_MIN)continue;

            //cout<<tmn[i]<<" "<<tmx[i]<<endl;
            int I=i,c=0;
            while(I<sz){
                I*=2;c++;
            }

            if(tmx[i]-tmn[i]>=pow(2,c)){
                int l=i,r=i;
                while(l<sz)l*=2;
                while(r<sz){r*=2;r++;}
                cout<<"YES\n"<<l-sz+1<<" "<<r-sz+1<<endl;
                goto e;
            }

        }
        cout<<"NO\n";
        e:
        x.clear();tmn.clear();tmx.clear();
    }
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t,n;cin>>t;
    while(t--){
        cin>>n;
        int x[n],mx=INT_MIN,mn=INT_MAX,l,r;
        map<int,set<int> >p;
        for(int i=0;i<n;i++){
            cin>>x[i];
            p[x[i]].insert(i);
        }
        sort(x,x+n);

        for(int i=0;i<n-1;i++){
            int mn1=*p[x[i]].begin();
            int mx1=*p[x[i]].rbegin();
            int mn2=*p[x[i+1]].begin();
            int mx2=*p[x[i+1]].rbegin();
            ///cout<<mn1<<" "<<mx1<<" "<<mn2<<" "<<mx2<<endl;
            int t[4]={abs(mn1-mx2),abs(mn1-mn2),abs(mx1-mn2),abs(mx1-mx2)},mnn=INT_MAX,v;

            for(int i=0;i<4;i++){
                if(t[i]<mnn){
                    mnn=t[i];
                    v=i;
                }
            }
            //cout<<"mnn="<<mnn<<endl;
            if(x[i+1]-x[i]>=mnn+1){
                cout<<"YES\n";
                if(v==0){
                    cout<<min(mn1,mx2)+1<<" "<<max(mn1,mx2)+1<<'\n';
                }
                else if(v==1){
                    cout<<min(mn1,mn2)+1<<" "<<max(mn1,mn2)+1<<'\n';
                }
                else if(v==2){
                    cout<<min(mx1,mn2)+1<<" "<<max(mx1,mn2)+1<<'\n';
                }
                else if(v==3){
                    cout<<min(mx1,mx2)+1<<" "<<max(mx1,mx2)+1<<'\n';
                }
                goto e;
            }
        }
        cout<<"NO\n";
        e:;
    }
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t,n;cin>>t;
    while(t--){
        cin>>n;int x[n];
        for(int i=0;i<n;i++)cin>>x[i];
        for(int i=0;i<n-1;i++){
            if(x[i+1]-x[i]>=2){
                cout<<"YES\n"<<i+1<<" "<<i+2<<'\n';
                goto h;
            }
        }
        cout<<"NO\n";
        h:;
    }
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t,n;cin>>t;
    while(t--){
        cin>>n;int x[n];
        for(int i=0;i<n;i++)cin>>x[i];
        for(int i=0;i<n-1;i++){
            if(abs(x[i+1]-x[i])>=2){
                cout<<"YES\n"<<i+1<<" "<<i+2<<'\n';
                goto h;
            }
        }
        cout<<"NO\n";
        h:;
    }
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t,n;cin>>t;
    while(t--){
        cin>>n;
        int x[n],mx=INT_MIN,mn=INT_MAX,l,r;
        for(int i=0;i<n;i++){
            cin>>x[i];
            if(x[i]>mx){
                mx=x[i];
                l=i+1;
            }
            if(x[i]<mn){
                mn=x[i];
                r=i+1;
            }
        }
        //cout<<mn<<" "<<mx<<endl;
        if(mx-mn>=n){
            cout<<"YES\n"<<min(l,r)<<" "<<max(l,r)<<'\n';
        }
        else cout<<"NO\n";

    }
}


#include <iostream>
#include <cmath>

using namespace std;

int t , n , v[200005];

int main()
{
    cin >> t;
    for(int i = 1 ; i <= t ; i ++)
    {
        cin >> n;
        int l = 0 , r = 0 , k = 0;
        for(int j = 1 ; j <= n ; j ++)
            cin >> v[j];
        l = 1;
        bool ok = 0;
        for(int j = 2 ; j <= n ; j ++)
            if(abs(v[j] - v[l]) < 2)
                l = j;
            else
            {
                r = j;
                ok = 1;
                break;
            }
        if(ok)
        {
            cout << "YES" << '\n';
            cout << l << ' ' << r << '\n';
        }
        else
            cout << "NO" << '\n';
    }
    return 0;
}


#include <iostream>

using namespace std;

int t , n;
long long x;

int main()
{
    cin >> t;
    for(int i = 1 ; i <= t ; i ++)
    {
        cin >> n;
        long long mini = 9999999999 , maxi = 0 , l = 0 , r = 0;
        for(int j = 1 ; j <= n ; j ++)
        {
            cin >> x;
            if(mini > x)
            {
                mini = x;
                l = j;
            }
            if(maxi < x)
            {
                maxi = x;
                r = j;
            }
        }
        if(maxi - mini >= n)
        {
            cout << "YES" << '\n';
            cout << l << ' ' << r << '\n';
        }
        else
            cout << "NO" << '\n';
    }
    return 0;
}


#include <iostream>

using namespace std;

int t , n;
long long x;

int main()
{
    cin >> t;
    for(int i = 1 ; i <= t ; i ++)
    {
        cin >> n;
        long long mini = 9999999999 , maxi = 0 , l = 0 , r = 0;
        for(int j = 1 ; j <= n ; j ++)
        {
            cin >> x;
            if(mini >= x)
            {
                mini = x;
                l = j;
            }
            if(maxi <= x)
            {
                maxi = x;
                r = j;
            }
        }
        if(maxi - mini >= n)
        {
            cout << "YES" << '\n';
            cout << l << ' ' << r << '\n';
        }
        else
            cout << "NO" << '\n';
    }
    return 0;
}


#include <iostream>

using namespace std;

int t , n , x;

int main()
{
    cin >> t;
    for(int i = 1 ; i <= t ; i ++)
    {
        cin >> n;
        int mini = 9999999999 , maxi = 0 , l = 0 , r = 0;
        for(int j = 1 ; j <= n ; j ++)
        {
            cin >> x;
            if(mini > x)
            {
                mini = x;
                l = j;
            }
            if(maxi < x)
            {
                maxi = x;
                r = j;
            }
        }
        if(maxi - mini >= n)
        {
            cout << "YES" << '\n';
            cout << l << ' ' << r << '\n';
        }
        else
            cout << "NO" << '\n';
    }
    return 0;
}


#include <iostream>

using namespace std;

int t , n , v[200005];

int main()
{
    cin >> t;
    for(int i = 1 ; i <= t ; i ++)
    {
        cin >> n;
        long long mini = 9999999999 , maxi = 0 , l = 0 , r = 0 , k = 0;
        for(int j = 1 ; j <= n ; j ++)
        {
            cin >> v[j];
            if(mini >= v[j])
                mini = v[j];
            if(maxi <= v[j])
            {
                maxi = v[j];
                k = j;
            }
        }
        if(maxi - mini >= n)
        {
            cout << "YES" << '\n';
            l = 1;
            for(int j = 1 ; j < k ; j ++)
                if(maxi - v[j] < n)
                    l = i + 1;
            r = n;
            for(int j = n ; j > k ; j --)
                if(maxi - v[j] < n)
                    r = i - 1;
            cout << l << ' ' << r << '\n';
        }
        else
            cout << "NO" << '\n';
    }
    return 0;
}


#include <iostream>

using namespace std;

int t , n , v[200005];

int main()
{
    cin >> t;
    for(int i = 1 ; i <= t ; i ++)
    {
        cin >> n;
        long long mini = 9999999999 , maxi = 0 , l = 0 , r = 0 , k = 0;
        for(int j = 1 ; j <= n ; j ++)
            cin >> v[j];
        l = 1;
        for(int j = 2 ; j <= n ; j ++)
            if((v[j] - v[l] < n) && (v[l] - v[j] < n))
                l = j;
            else
            {
                r = j;
                break;
            }
        if(l != n)
        {
            cout << "YES" << '\n';
            cout << l << ' ' << r << '\n';
        }
        else
            cout << "NO" << '\n';
    }
    return 0;
}


#include <iostream>

using namespace std;

int t , n , v[200005];

int main()
{
    cin >> t;
    for(int i = 1 ; i <= t ; i ++)
    {
        cin >> n;
        long long mini = 9999999999 , maxi = 0 , l = 0 , r = 0 , k = 0;
        for(int j = 1 ; j <= n ; j ++)
        {
            cin >> v[j];
            if(mini >= v[j])
                mini = v[j];
            if(maxi <= v[j])
            {
                maxi = v[j];
                k = j;
            }
        }
        if(maxi - mini >= n)
        {
            cout << "YES" << '\n';
            l = 1;
            for(int j = 1 ; j < k ; j ++)
                if(maxi - v[j] < n)
                    l = j + 1;
            r = n;
            for(int j = n ; j > k ; j --)
                if(maxi - v[j] < n)
                    r = j - 1;
            cout << l << ' ' << r << '\n';
        }
        else
            cout << "NO" << '\n';
    }
    return 0;
}


#include <iostream>

using namespace std;

int t , n , x;

int main()
{
    cin >> t;
    for(int i = 1 ; i <= t ; i ++)
    {
        cin >> n;
        int mini = 9999999999 , maxi = 0 , l , r;
        for(int j = 1 ; j <= n ; j ++)
        {
            cin >> x;
            mini = min(mini , x);
            if(mini == x)
                l = j;
            maxi = max(maxi , x);
            if(maxi == x)
                r = j;
        }
        if(maxi - mini >= n)
        {
            cout << "YES" << '\n';
            cout << min(l , r) << ' ' << max(l , r) << '\n';
        }
        else
            cout << "NO" << '\n';
    }
    return 0;
}


#include <iostream>

using namespace std;

int t , n , v[200005];

int main()
{
    cin >> t;
    for(int i = 1 ; i <= t ; i ++)
    {
        cin >> n;
        long long mini = 9999999999 , maxi = 0 , l = 0 , r = 0 , k = 0;
        for(int j = 1 ; j <= n ; j ++)
            cin >> v[j];
        l = 1;
        for(int j = 2 ; j <= n ; j ++)
            if(v[j] - v[l] < n)
                l = j;
            else
            {
                r = j;
                break;
            }
        if(l != n)
        {
            cout << "YES" << '\n';
            cout << l << ' ' << r << '\n';
        }
        else
            cout << "NO" << '\n';
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
    long long int n,x,y,i,a=0,b;
    cin>>n>>x;
    for(i=1;i<n;i++)
    { cin>>y;
    if(x-y>1||y-x>1)
   { a++;b=i;}
   x=y;}
   if(a==0)
   cout<<"NO"<<endl;
   else cout<<"YES"<<endl<<b<<' '<<b+1<<endl;}}


#include <iostream>
using namespace std;

int main()
{
  int n,k,i,max,min,x,y,j,l;
  int arr[10];
  cin>>n;
  for(i=1;i<=n;i++)
  {
      cin>>k;
      for(j=0;j<k;j++)
         cin>>arr[j];
         max=arr[0];
         min=arr[0];
         for(l=1;l<k;l++)
         {
             if(arr[l]>max)
              {  max=arr[l];
                x=l+1;
              }

              if(arr[l]<min)
            { min=arr[l];
            y=l+1;

         }
         }

  if(max-min>=k)
  {
      cout<<"YES"<<endl;
      cout<<y<<" "<<x<<endl;
  }
  else
  cout<<"NO"<<endl;
  }

return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
    long long int n,x,y,i,a=0;
    cin>>n>>x;
    for(i=1;i<n;i++)
    { cin>>y;
    if(x-y>1||y-x>1)
   { a++;break;}
   x=y;}
   if(a==0)
   cout<<"NO"<<endl;
   else cout<<"YES"<<endl<<i<<' '<<i+1<<endl;}}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
    long long int n,x;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n;i++)
    { cin>>x;v.push_back(x);}
    int m1=*min_element(v.begin(),v.end());
    int m2=*max_element(v.begin(),v.end());
    if(m2-m1<n)
    cout<<"NO"<<endl;
    else
    { cout<<"YES"<<endl;
    int a=min_element(v.begin(),v.end())-v.begin();
     int b=max_element(v.begin(),v.end())-v.begin();
     cout<<min(a,b)+1<<' '<<max(a,b)+1<<endl;}}}


#include <iostream>
using namespace std;

int main()
{
  int n,k,i,max,min,x,y,j,l;
  int arr[100];
  cin>>n;
  for(i=1;i<=n;i++)
  {   x=1,y=1;
      cin>>k;
      for(j=0;j<k;j++)
         cin>>arr[j];
         max=arr[0];
         min=arr[0];
         for(l=1;l<k;l++)
         {
             if(arr[l]>max)
              {  max=arr[l];
                x=l+1;
              }

              if(arr[l]<min)
            { min=arr[l];
            y=l+1;

         }
         }

  if(max-min>=k)
  {
      cout<<"YES"<<endl;
      if(x>y)
      cout<<y<<" "<<x<<endl;
      else
      cout<<x<<" "<<y<<endl;
  }
  else
  cout<<"NO"<<endl;
  }

return 0;

}


#include <iostream.h>
using namespace std;

int main()
{
  int n,k,i,max,min,x,y,j,l;
  int arr[10];
  cin>>n;
  for(i=1;i<=n;i++)
  {
      cin>>k;
      for(j=0;j<k;j++)
         cin>>arr[j];
         max=arr[0];
         min=arr[0];
         for(l=1;l<k;l++)
         {
             if(arr[l]>max)
              {  max=arr[l];
                x=l+1;
              }

              if(arr[l]<min)
            { min=arr[l];
            y=l+1;

         }
         }

  if(max-min>=k)
  {
      cout<<"YES"<<endl;
      cout<<y<<" "<<x<<endl;
  }
  else
  cout<<"NO"<<endl;
  }

return 0;

}


#include <iostream>
using namespace std;

int main()
{
  int n,k,i,max,min,x,y,j,l;
  int arr[100];
  cin>>n;
  for(i=1;i<=n;i++)
  {   x=1,y=1;
      cin>>k;
      for(j=0;j<k;j++)
         cin>>arr[j];
         max=arr[0];
         min=arr[0];
         for(l=1;l<k;l++)
         {
             if(arr[l]>max)
              {  max=arr[l];
                x=l+1;
              }

              if(arr[l]<min)
            { min=arr[l];
            y=l+1;

         }
         }

  if(max-min>=k)
  {
      cout<<"YES"<<endl;
      cout<<y<<" "<<x<<endl;
  }
  else
  cout<<"NO"<<endl;
  }

return 0;

}


#include<iostream>
#include<queue>
using namespace std;
deque<int> qmax; //用双端队列维持连续子数组的最大值。
	deque<int> qmin; //用双端队列维持连续子数组的最小值。
int arr[200005];
int main(){
    int t;
    cin>>t;
    while(t--){
        int flag=0;
        int size;
        cin>>size;
        for(int i=1;i<=size;i++) cin>>arr[i];
        int res = 0; //子数组的个数。
	int i = 1;
	int j = 1;

	while (i < size&&!flag)
	{
		while (j < size&&!flag)
		{
			while (!qmax.empty() && arr[qmax.back()] <= arr[j]) //求子数组的最大值。
			{
				qmax.pop_back();
			}
			qmax.push_back(j);

			while (!qmin.empty() && arr[qmin.back()]>= arr[j])//子数组的最小值。
			{
				qmin.pop_back();
			}
			qmin.push_back(j);

			if (arr[qmax.front()] - arr[qmin.front()] >=j-i+1 )
			{
				if(i<j){cout<<"YES"<<endl;
                cout<<i<<" "<<j<<endl;
                flag=1;}
			}
			j++;
		}

		res += j-i;  //算出以i为起始点的连续子数组的个数。

		// 因为已经算出以i为起始点的连续子数组的个数，下次就是以i+1为起始位置了，所以如果max/min中含有i，则需要移除
		if (qmin.front() == i)
		{
			qmin.pop_front();
		}
		if (qmax.front() == i)
		{
			qmax.pop_front();
		}

		i++;
	}
    if(!flag) cout<<"NO"<<endl;
}
    }


#include <bits/stdc++.h>
using namespace std;
struct node{
    int value;
    int index;

    }num[200005];
    bool cmp(struct node first,struct node second){
        if(first.value<second.value||(first.value==second.value&&first.index<second.index)){
            return true;
        }
        else return false;
    }
int main(){
    int t;
    cin>>t;
    while(t--){
        int n=0;
        cin>>n;
        for(int i=0;i<n;i++) {
            cin>>num[i].value;
            num[i].index=i;
        }
        // sort(num,num+n,cmp);
        // for(int i=0;i<n;i++) cout<<num[i].value<<" "<<num[i].index<<endl;
        int j=0;
        for(int i=0;i<n-1;i++){
        if(num[i+1].value-num[i].value>=2){
             cout<<"YES"<<endl;
                cout<<i<<" "<<i+1<<endl;
                j=1;
                break;
        }

            // if((wid=num[i].index-num[j].index>0)&&num[i].value-num[j].value>=wid){
            //     cout<<"YES"<<endl;
            //     cout<<num[j].index<<" "<<num[i].index<<endl;
            //     break;
            // }
        }
        if(!j) cout<<"NO"<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
struct node{
    int value;
    int index;

    }num[200005];
    bool cmp(struct node first,struct node second){
        if(first.value<second.value||(first.value==second.value&&first.index<second.index)){
            return true;
        }
        else return false;
    }
int main(){
    int t;
    cin>>t;
    while(t--){
        int n=0;
        cin>>n;
        for(int i=0;i<n;i++) {
            cin>>num[i].value;
            num[i].index=i;
        }
        sort(num,num+n,cmp);
        // for(int i=0;i<n;i++) cout<<num[i].value<<" "<<num[i].index<<endl;
        int j=0;
        for(int i=0;i<n-1;i++){
        int wid=0;
            if((wid=num[i+1].index-num[i].index>0)&&num[i+1].value-num[i].value>=wid+1){
                cout<<"YES"<<endl;
                cout<<num[i].index<<" "<<num[i+1].index<<endl;
                j=1;
                break;
        }

    } if(!j) cout<<"NO"<<endl;
    }
}


#include <bits/stdc++.h>
#define endln '\n'
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;

ll modVal(string num)
{
    ll res = 0;
    for (ll i = 0; i < num.length(); i++)
        res = (res * 10 + (ll)num[i] - '0') % mod;

    return res;
}

void solve()
{
    string s;
    cin >> s;
    ll ansVal = 0;
    for (ll i = 0; i < s.size(); i++)
    {
        for (ll j = i + 1; j <= s.size(); j++)
        {
            if (j != s.size())
            {
                string ans = s.substr(0, i) + s.substr(j);
                ansVal = ((ansVal % mod) + (modVal(ans) % mod)) % mod;
            }
            else
            {
                string ans = s.substr(0, i);
                ansVal = ((ansVal % mod) + (modVal(ans) % mod)) % mod;
            }
        }
    }
    cout << ansVal % mod;
}

int main()
{
    // freopen("in.txt", "r", stdin);
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll maxN = 1e6 + 5;
const ll mod = 1e9 + 7;

/*
before subarray; (n)(n+1)/2
after subarray: 54321
*/

ll powmod(ll base, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    if (p & 1)
    {
        return (base * powmod(base, p - 1));
    }
    else
    {
        return (powmod(base * base, p / 2));
    }
}

void solve()
{
    string n;
    cin >> n;
    ll len = n.size();
    ll times = 0;
    ll add = 1;
    ll curNum = 1;
    ll power = 0;
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        ll num = n[i] - '0';
        ans += times * num;
        ans %= mod;
        times += (curNum * add);
        times %= mod;
        add *= 10;
        add %= mod;
        curNum++;
        assert(((i) * (i + 1) / 2 * num) >= 0);
        ans += ((((i) * (i + 1) / 2 * num) % mod) * powmod(10, power++)) % mod;
        ans %= mod;
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;
const ll maxN = 10000;
ll dp[maxN][maxN];

void solve()
{
    string s;
    cin >> s;
    ll len = s.size();
    if (len > maxN)
    {
        cout << 0;
        return;
    }
    for (ll i = 0; i < len; i++)
    {
        ll res = s[i] - '0';
        dp[i][0] = res;
        for (ll j = 1; j <= len; j++)
        {
            res *= 10;
            res %= mod;
            dp[i][j] = res;
        }
    }
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        for (ll j = i - 1; j >= -1; j--)
        {
            ll temp = 0;
            ll before = 0;
            for (ll k = len - 1; k > i; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            for (ll k = j; k >= 0; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            ans = ((ans % mod) + (temp % mod)) % mod;
        }
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;
const ll maxN = 6000;
ll dp[maxN][maxN];

void solve()
{
    string s;
    cin >> s;
    ll len = s.size();
    if (len > maxN)
    {
        cout << 0;
        return;
    }
    for (ll i = 0; i < len; i++)
    {
        ll res = s[i] - '0';
        dp[i][0] = res;
        for (ll j = 1; j <= len; j++)
        {
            res *= 10;
            res %= mod;
            dp[i][j] = res;
        }
    }
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        for (ll j = i - 1; j >= -1; j--)
        {
            ll temp = 0;
            ll before = 0;
            for (ll k = len - 1; k > i; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            for (ll k = j; k >= 0; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            ans = ((ans % mod) + (temp % mod)) % mod;
        }
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;
const ll maxN = 6000;
int dp[maxN][maxN];

void solve()
{
    string s;
    cin >> s;
    ll len = s.size();
    assert(len < maxN);
    for (ll i = 0; i < len; i++)
    {
        ll res = s[i] - '0';
        dp[i][0] = res;
        for (ll j = 1; j <= len; j++)
        {
            res *= 10;
            res %= mod;
            dp[i][j] = res;
        }
    }
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        for (ll j = i - 1; j >= -1; j--)
        {
            ll temp = 0;
            ll before = 0;
            for (ll k = len - 1; k > i; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            for (ll k = j; k >= 0; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            ans = ((ans % mod) + (temp % mod)) % mod;
        }
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;
const ll maxN = 100;
ll dp[maxN][maxN];
ll modVal(string num)
{
    ll res = 0;
    for (ll i = 0; i < num.length(); i++)
        res = (res * 10 + (ll)num[i] - '0') % mod;

    return res;
}

void solve()
{
    string s;
    cin >> s;
    ll len = s.size();
    for (ll i = 0; i < len; i++)
    {
        ll pos = len - i - 1;
        ll pos2 = pos;
        ll res = s[i] - '0';
        dp[i][0] = res;
        for (ll j = 1; j < len; j++)
        {
            res *= 10;
            res %= mod;
            dp[i][j] = res;
        }
    }
    ll ans = 0;
    for (ll i = len - 1; i >= -1; i--)
    {
        for (ll j = i - 1; j >= -1; j--)
        {
            ll temp = 0;
            ll before = 0;
            for (ll k = len - 1; k > i; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            for (ll k = j; k >= 0; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            ans = ((ans % mod) + (temp % mod)) % mod;
        }
    }
    cout << ans;
}

int main()
{
    // freopen("in.txt", "r", stdin);
    ios_base::sync_with_stdio(false);
    memset(dp, sizeof(dp), 0);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll maxN = 1e6 + 5;
const ll mod = 1e9 + 7;

/*
before subarray; (n)(n+1)/2
after subarray: 54321
*/

ll powmod(ll base, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    if (p & 1)
    {
        return (base * powmod(base, p - 1));
    }
    else
    {
        return (powmod(base * base, p / 2));
    }
}

void solve()
{
    string n;
    cin >> n;
    ll len = n.size();
    ll times = 0;
    ll add = 1;
    ll curNum = 1;
    ll power = 0;
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        ll num = n[i] - '0';
        ans += times * num;
        ans %= mod;
        times += (curNum * add);
        times %= mod;
        add *= 10;
        add %= mod;
        curNum++;
        curNum %= 10;
        if (!curNum)
        {
            curNum++;
        }
        assert(((i) * (i + 1) / 2 * num) >= 0);
        ans += (((i) * (i + 1) / 2 * num) % mod) * powmod(10, power++);
        ans %= mod;
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;

ll modVal(string num)
{
    ll res = 0;
    for (ll i = 0; i < num.length(); i++)
        res = (res * 10 + (ll)num[i] - '0') % mod;

    return res;
}

void solve()
{
    string s;
    cin >> s;
    ll ansVal = 0;
    for (ll i = 0; i < s.size(); i++)
    {
        for (ll j = i + 1; j <= s.size(); j++)
        {
            if (j != s.size())
            {
                string ans = s.substr(0, i) + s.substr(j);
                ansVal = ((ansVal % mod) + (modVal(ans) % mod)) % mod;
            }
            else
            {
                string ans = s.substr(0, i);
                ansVal = ((ansVal % mod) + (modVal(ans) % mod)) % mod;
            }
        }
    }
    cout << ansVal % mod;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;
const ll maxN = 6000;
int dp[maxN][maxN];

void solve()
{
    string s;
    cin >> s;
    ll len = s.size();
    if (len > maxN)
    {
        cout << 0;
        return;
    }
    for (ll i = 0; i < len; i++)
    {
        ll res = s[i] - '0';
        dp[i][0] = res;
        for (ll j = 1; j <= len; j++)
        {
            res *= 10;
            res %= mod;
            dp[i][j] = res;
        }
    }
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        for (ll j = i - 1; j >= -1; j--)
        {
            ll temp = 0;
            ll before = 0;
            for (ll k = len - 1; k > i; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            for (ll k = j; k >= 0; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            ans = ((ans % mod) + (temp % mod)) % mod;
        }
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll maxN = 1e6 + 5;
const ll mod = 1e9 + 7;

/*
before subarray; (n)(n+1)/2
after subarray: 54321
*/

ll powmod(ll base, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    if (p & 1)
    {
        return (base * powmod(base, p - 1));
    }
    else
    {
        return (powmod(base * base, p / 2));
    }
}

void solve()
{
    string n;
    cin >> n;
    ll len = n.size();
    ll times = 0;
    ll add = 1;
    ll curNum = 1;
    ll power = 0;
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        ll num = n[i] - '0';
        ans = ((ans % mod) + (times * num) % mod) % mod;
        times = ((times % mod) + (curNum * add) % mod) % mod;
        add *= 10;
        add %= mod;
        curNum++;
        assert(((i) * (i + 1) / 2 * num) >= 0);
        ans = ((ans % mod) + ((((i) * (i + 1) / 2 * num) % mod) * powmod(10, power++)) % mod) % mod;
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
#define endln '\n'
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;
const ll maxN = 6000;
int dp[maxN][maxN];

void solve()
{
    string s;
    cin >> s;
    ll len = s.size();
    for (ll i = 0; i < len; i++)
    {
        ll res = s[i] - '0';
        dp[i][0] = res;
        for (ll j = 1; j <= len; j++)
        {
            res *= 10;
            res %= mod;
            dp[i][j] = res;
        }
    }
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        for (ll j = i - 1; j >= -1; j--)
        {
            ll temp = 0;
            ll before = 0;
            for (ll k = len - 1; k > i; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            for (ll k = j; k >= 0; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            ans = ((ans % mod) + (temp % mod)) % mod;
        }
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;
const ll maxN = 600;
ll dp[maxN][maxN];

void solve()
{
    string s;
    cin >> s;
    ll len = s.size();
    if (len > maxN)
    {
        cout << 0;
        return;
    }
    for (ll i = 0; i < len; i++)
    {
        ll res = s[i] - '0';
        dp[i][0] = res;
        for (ll j = 1; j <= len; j++)
        {
            res *= 10;
            res %= mod;
            dp[i][j] = res;
        }
    }
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        for (ll j = i - 1; j >= -1; j--)
        {
            ll temp = 0;
            ll before = 0;
            for (ll k = len - 1; k > i; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            for (ll k = j; k >= 0; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            ans = ((ans % mod) + (temp % mod)) % mod;
        }
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;
const ll maxN = 6000;
ll dp[maxN][maxN];

void solve()
{
    string s;
    cin >> s;
    ll len = s.size();
    if (len > maxN)
    {
        cout << 0;
        return;
    }
    for (ll i = 0; i < len; i++)
    {
        ll res = s[i] - '0';
        dp[i][0] = res;
        for (ll j = 1; j <= len; j++)
        {
            res *= 10;
            res %= mod;
            dp[i][j] = res;
        }
    }
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        for (ll j = i - 1; j >= -1; j--)
        {
            ll temp = 0;
            ll before = 0;
            for (ll k = len - 1; k > i; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            for (ll k = j; k >= 0; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            ans = ((ans % mod) + (temp % mod)) % mod;
        }
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <bits/stdc++.h>
#define endln '\n'
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
const ll inf = INT_MAX - 1;
const ll mod = 1e9 + 7;
const ll maxN = 600;
ll dp[maxN][maxN];

void solve()
{
    string s;
    cin >> s;
    ll len = s.size();
    for (ll i = 0; i < len; i++)
    {
        ll res = s[i] - '0';
        dp[i][0] = res;
        for (ll j = 1; j <= len; j++)
        {
            res *= 10;
            res %= mod;
            dp[i][j] = res;
        }
    }
    ll ans = 0;
    for (ll i = len - 1; i >= 0; i--)
    {
        for (ll j = i - 1; j >= -1; j--)
        {
            ll temp = 0;
            ll before = 0;
            for (ll k = len - 1; k > i; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            for (ll k = j; k >= 0; k--)
            {
                temp = ((temp % mod) + (dp[k][before++] % mod)) % mod;
            }
            ans = ((ans % mod) + (temp % mod)) % mod;
        }
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
}


#include <iostream>
#include<bits/stdc++.h>

int n, k;
//#include<pair>
using namespace std;
const long long MAX_SIZE = 1000001;
typedef long long  ll;
const ll mod= 1000000007;
ll func(ll n)
{   ll sum = 0;
//cout<<n<<endl;
    for (ll i = n; i >= 1; i--)
    {  // cout << pow(10, 2) << " " << i - 1 << endl;
        ll ann = pow(10, i - 1);
        sum+=(i)*ann;
        //cout<<sum<< "agr" << ann << endl;
    }
  //  cout << n << "rtg" << sum << endl;
    return sum;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
// #ifndef ONLINE_JUDGE
//     // cout << "hh" << endl;
//     freopen("new_inp2.txt", "r", stdin);
//     freopen("cmmo.txt", "w", stdout);
// #endif
    ll n;
    cin >> n;
    string str = to_string(n);
    int len = str.length();
    ll ans = 0;
    for (int i = 0; i < str.length(); i++)
    {   //int x = atoi(str[i]);
        int x =(int)(str[i])-48;
        ll a = (((x * ((ll)(pow(10, len - i - 1)))%mod)%mod) * ((i) * (i + 1) / 2)%mod);
        ll res = func(len - i-1);
        // cout <<x<< "rdd" << res << endl;

        ll b = (x * (res))%mod;
        //cout<<a<<"ec"<<b<<endl;
        ans+=a + b;
        ans=ans%mod;
    }
    cout << ans << endl;

}


#include <iostream>
#include<bits/stdc++.h>

int n, k;
//#include<pair>
using namespace std;
const long long MAX_SIZE = 1000001;
typedef long long  ll;
const ll mod= 1000000007;
ll func(ll n,vector<ll> poo)
{   ll sum = 0;
//cout<<n<<endl;
    for (ll i = n; i >= 1; i--)
    {  // cout << pow(10, 2) << " " << i - 1 << endl;
        ll ann = poo[i-1];
        sum+=((i)*ann)%mod;
        sum=sum%mod;
        //cout<<sum<< "agr" << ann << endl;
    }
  //  cout << n << "rtg" << sum << endl;
    return sum;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
// #ifndef ONLINE_JUDGE
//     // cout << "hh" << endl;
//     freopen("new_inp2.txt", "r", stdin);
//     freopen("cmmo.txt", "w", stdout);
// #endif
    ll n;
    string str;
    cin>>str;
    int len = str.length();
    vector<ll> poo(len+1),num(len+1),vect(len+1);
    poo[0]=1;
    num[0]=str[0]-'0';
    vect[0]=1;
    for(int i=1;i<=len;i++)
    {   num[i]=str[i]-'0';
    poo[i]=(poo[i-1]*10)%mod;
        vect[i]=(vect[i-1]+((i+1)*(poo[i-1]*10)))%mod;
    }
    ll ans = 0;
    // for(int i=0;i<8;i++)
    // {
    //     cout<<poo[i]<<" ";
    // }
    // cout<<endl;
    // for(int i=0;i<14;i++)
    // {
    //     cout<<vect[i]<<" ";
    // }
    // cout<<endl;
    for (ll i = 0; i < str.length(); i++)
    {   //int x = atoi(str[i]);
        ll x =num[i];
        ll a = (((x * ((poo[len-i-1]%mod)%mod) * ((i) * (i + 1) / 2)%mod)));
        ll res =vect[len-i-2];
        // cout <<x<< "rdd" << res << endl;

        ll b = (x * (res))%mod;
        //cout<<a<<"ec"<<b<<endl;
        ans+=(a + b)%mod;
        ans=ans%mod;
        //cout<<"ff"<<ans<<endl;
    }
    cout << ans << endl;

}


#include <iostream>
#include<bits/stdc++.h>

int n, k;
//#include<pair>
using namespace std;
const long long MAX_SIZE = 1000001;
typedef long long  ll;
const ll mod= 1000000007;
ll func(ll n,vector<ll> poo)
{   ll sum = 0;
//cout<<n<<endl;
    for (ll i = n; i >= 1; i--)
    {  // cout << pow(10, 2) << " " << i - 1 << endl;
        ll ann = poo[i-1];
        sum+=((i)*ann)%mod;
        sum=sum%mod;
        //cout<<sum<< "agr" << ann << endl;
    }
  //  cout << n << "rtg" << sum << endl;
    return sum;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
// #ifndef ONLINE_JUDGE
//     // cout << "hh" << endl;
//     freopen("new_inp2.txt", "r", stdin);
//     freopen("cmmo.txt", "w", stdout);
// #endif
    ll n;
    string str;
    cin>>str;
    int len = str.length();
    vector<ll> poo(len+1),num(len+1);
    poo[0]=1;
    num[0]=str[0]-'0';
    for(int i=1;i<=len;i++)
    {   num[i]=str[i]-'0';
        poo[i]=(poo[i-1]*10)%mod;
    }
    ll ans = 0;
    for (ll i = 0; i < str.length(); i++)
    {   //int x = atoi(str[i]);
        int x =num[i];
        ll a = (((x * ((poo[len-i-1]%mod)%mod) * ((i) * (i + 1) / 2)%mod)));
        ll res = func(len - i-1,poo);
        // cout <<x<< "rdd" << res << endl;

        ll b = (x * (res))%mod;
        //cout<<a<<"ec"<<b<<endl;
        ans+=(a + b)%mod;
        ans=ans%mod;
        //cout<<"ff"<<ans<<endl;
    }
    cout << ans << endl;

}


#include <iostream>
#include<bits/stdc++.h>

int n, k;
//#include<pair>
using namespace std;
const long long MAX_SIZE = 1000001;
typedef long long  ll;
const ll mod= 1000000007;
ll func(ll n,vector<ll> poo)
{   ll sum = 0;
//cout<<n<<endl;
    for (ll i = n; i >= 1; i--)
    {  // cout << pow(10, 2) << " " << i - 1 << endl;
        ll ann = poo[i-1];
        sum+=(i)*ann;
        sum=sum%mod;
        //cout<<sum<< "agr" << ann << endl;
    }
  //  cout << n << "rtg" << sum << endl;
    return sum;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
// #ifndef ONLINE_JUDGE
//     // cout << "hh" << endl;
//     freopen("new_inp2.txt", "r", stdin);
//     freopen("cmmo.txt", "w", stdout);
// #endif
    ll n;
    cin >> n;
    string str = to_string(n);
    int len = str.length();
    vector<ll> poo(len+1);
    poo[0]=1;
    for(int i=1;i<=len;i++)
    {
        poo[i]=(poo[i-1]*10)%mod;
    }
    ll ans = 0;
    for (int i = 0; i < str.length(); i++)
    {   //int x = atoi(str[i]);
        int x =(int)(str[i])-48;
        ll a = (((x * ((ll)(pow(10, len - i - 1)))%mod)%mod) * ((i) * (i + 1) / 2)%mod);
        ll res = func(len - i-1,poo);
        // cout <<x<< "rdd" << res << endl;

        ll b = (x * (res))%mod;
        //cout<<a<<"ec"<<b<<endl;
        ans+=a + b;
        ans=ans%mod;
    }
    cout << ans << endl;

}


#include <iostream>
#include<bits/stdc++.h>

int n, k;
//#include<pair>
using namespace std;
const long long MAX_SIZE = 1000001;
typedef long long  ll;
const ll mod= 1000000007;
ll func(ll n,vector<ll> poo)
{   ll sum = 0;
//cout<<n<<endl;
    for (ll i = n; i >= 1; i--)
    {  // cout << pow(10, 2) << " " << i - 1 << endl;
        ll ann = poo[i-1];
        sum+=((i)*ann)%mod;
        sum=sum%mod;
        //cout<<sum<< "agr" << ann << endl;
    }
  //  cout << n << "rtg" << sum << endl;
    return sum;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
// #ifndef ONLINE_JUDGE
//     // cout << "hh" << endl;
//     freopen("new_inp2.txt", "r", stdin);
//     freopen("cmmo.txt", "w", stdout);
// #endif
    ll n;
    string str;
    cin>>str;
    int len = str.length();
    vector<ll> poo(len+1),num(len+1),vect(len+1);
    poo[0]=1;
    num[0]=str[0]-'0';
    vect[0]=1;
    for(int i=1;i<=len;i++)
    {   num[i]=str[i]-'0';
    poo[i]=(poo[i-1]*10)%mod;
        vect[i]=(vect[i-1]+((i+1)*(poo[i-1]*10)))%mod;
    }
    ll ans = 0;
    // for(int i=0;i<8;i++)
    // {
    //     cout<<poo[i]<<" ";
    // }
    // cout<<endl;
    // for(int i=0;i<14;i++)
    // {
    //     cout<<vect[i]<<" ";
    // }
    // cout<<endl;
    for (ll i = 0; i < str.length(); i++)
    {   //int x = atoi(str[i]);
        ll x =num[i];
        ll a = (((x * ((poo[len-i-1]%mod))%mod) * ((i) * (i + 1) / 2)%mod));
        ll res;
        if(i==len-1)
        {
            res=0;
        }
        else
        {
              res =vect[len-i-2];
        }

        // cout <<x<< "rdd" << res << endl;

        ll b = (x * (res))%mod;
       // cout<<a<<"ec"<<b<<endl;
        ans+=(a + b)%mod;
        ans=ans%mod;
        //cout<<"ff"<<ans<<endl;
    }
    cout << ans << endl;

}


#include <iostream>
#include<bits/stdc++.h>

int n, k;
//#include<pair>
using namespace std;
const long long MAX_SIZE = 1000001;
typedef long long  ll;
const ll mod= 1000000007;
ll func(ll n,vector<ll> poo)
{   ll sum = 0;
//cout<<n<<endl;
    for (ll i = n; i >= 1; i--)
    {  // cout << pow(10, 2) << " " << i - 1 << endl;
        ll ann = poo[i-1];
        sum+=((i)*ann)%mod;
        sum=sum%mod;
        //cout<<sum<< "agr" << ann << endl;
    }
  //  cout << n << "rtg" << sum << endl;
    return sum;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
// #ifndef ONLINE_JUDGE
//     // cout << "hh" << endl;
//     freopen("new_inp2.txt", "r", stdin);
//     freopen("cmmo.txt", "w", stdout);
// #endif
    ll n;
    string str;
    cin>>str;
    int len = str.length();
    vector<ll> poo(len+1),num(len+1),vect(len+1);
    poo[0]=1;
    num[0]=str[0]-'0';
    vect[0]=1;
    for(int i=1;i<=len;i++)
    {   num[i]=str[i]-'0';
    poo[i]=(poo[i-1]*10)%mod;
        vect[i]=(vect[i-1]+((i+1)*(poo[i-1]*10)))%mod;
    }
    ll ans = 0;
    // for(int i=0;i<8;i++)
    // {
    //     cout<<poo[i]<<" ";
    // }
    // cout<<endl;
    // for(int i=0;i<14;i++)
    // {
    //     cout<<vect[i]<<" ";
    // }
    // cout<<endl;
    for (ll i = 0; i < str.length(); i++)
    {   //int x = atoi(str[i]);
        ll x =num[i];
        ll a = (((x * ((poo[len-i-1]%mod)%mod) * ((i) * (i + 1) / 2)%mod)));
        ll res;
        if(i==len-1)
        {
            res=0;
        }
        else
        {
              res =vect[len-i-2];
        }

        // cout <<x<< "rdd" << res << endl;

        ll b = (x * (res))%mod;
       // cout<<a<<"ec"<<b<<endl;
        ans+=(a + b)%mod;
        ans=ans%mod;
        //cout<<"ff"<<ans<<endl;
    }
    cout << ans << endl;

}


#include <iostream>
#include<bits/stdc++.h>

int n, k;
//#include<pair>
using namespace std;
const long long MAX_SIZE = 1000001;
typedef long long  ll;
const ll mod= 1000000007;
ll func(ll n,vector<ll> poo)
{   ll sum = 0;
//cout<<n<<endl;
    for (ll i = n; i >= 1; i--)
    {  // cout << pow(10, 2) << " " << i - 1 << endl;
        ll ann = poo[i-1];
        sum+=(i)*ann;
        sum=sum%mod;
        //cout<<sum<< "agr" << ann << endl;
    }
  //  cout << n << "rtg" << sum << endl;
    return sum;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
// #ifndef ONLINE_JUDGE
//     // cout << "hh" << endl;
//     freopen("new_inp2.txt", "r", stdin);
//     freopen("cmmo.txt", "w", stdout);
// #endif
    ll n;
    cin >> n;
    string str = to_string(n);
    int len = str.length();
    vector<ll> poo(len+1);
    poo[0]=1;
    for(int i=1;i<=len;i++)
    {
        poo[i]=(poo[i-1]*10)%mod;
    }
    ll ans = 0;
    for (int i = 0; i < str.length(); i++)
    {   //int x = atoi(str[i]);
        int x =(int)(str[i])-48;
        ll a = (((x * ((poo[len-i-1]%mod)%mod) * ((i) * (i + 1) / 2)%mod)));
        ll res = func(len - i-1,poo);
        // cout <<x<< "rdd" << res << endl;

        ll b = (x * (res))%mod;
        //cout<<a<<"ec"<<b<<endl;
        ans+=a + b;
        ans=ans%mod;
    }
    cout << ans << endl;

}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rrep(i, n) for(int i = (int)(n) - 1; i >= 0; i --)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define sll set<ll>
#define spll set<pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod2 998244353
#define inf 1000000000000000000
#define pi acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rsort(a) sort(a.rbegin(), a.rend())
#define print(x) for(auto i : (x)) cout << i << " "; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll dx[] = {-1,0,1,0,-1,-1,1,1};
const ll dy[] = {0,-1,0,1,-1,1,-1,1};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(15) << fixed;

    ll ans = 0;
    string n;
    cin >> n;
    ll m = n.size();
    vll table(m + 1, 0);
    vll table_2(m + 1, 1);
    rep(i, m) {
        table_2[i + 1] = table_2[i] * 10;
        table_2[i + 1] %= mod;
    }
    rep(i, m) {
        table[i + 1] = table[i] + (i + 1) * table_2[i];
        table[i + 1] %= mod;
    }
    rep(i, m) {
        ll a = n[i] - '0';
        ans += a * table[m - i - 1];
        ans %= mod;
        ll add = (a * table_2[m - i - 1]);
        add %= mod;
        if (i % 2 == 0) {
            add *= i / 2;
            add %= mod;
            add *= (i + 1);
            add %= mod;
        }else {
            add *= (i + 1) / 2;
            add %= mod;
            add *= i;
            add %= mod;

        }

        ans += add;
        ans %= mod;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rrep(i, n) for(int i = (int)(n) - 1; i >= 0; i --)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define sll set<ll>
#define spll set<pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod2 998244353
#define inf 1000000000000000000
#define pi acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rsort(a) sort(a.rbegin(), a.rend())
#define print(x) for(auto i : (x)) cout << i << " "; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll dx[] = {-1,0,1,0,-1,-1,1,1};
const ll dy[] = {0,-1,0,1,-1,1,-1,1};
// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};

const int MOD = 1000000007;
using mint = Fp<MOD>;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(15) << fixed;

    mint ans = 0;
    string n;
    cin >> n;
    ll m = n.size();
    vll table(m + 1, 0);
    vll table_2(m + 1, 1);
    rep(i, m) {
        table_2[i + 1] = table_2[i] * 10;
        table_2[i + 1] %= mod;
    }
    rep(i, m) {
        table[i + 1] = table[i] + (i + 1) * table_2[i];
        table[i + 1] %= mod;
    }
    rep(i, m) {
        ll a = n[i] - '0';
        ans += a * table[m - i - 1];
        mint add = 1;
        add *= a * table_2[m - i - 1];
        add *= (mint)i * (mint)(i + 1) / 2;
        ans += add;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rrep(i, n) for(int i = (int)(n) - 1; i >= 0; i --)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define sll set<ll>
#define spll set<pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod2 998244353
#define inf 1000000000000000000
#define pi acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rsort(a) sort(a.rbegin(), a.rend())
#define print(x) for(auto i : (x)) cout << i << " "; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll dx[] = {-1,0,1,0,-1,-1,1,1};
const ll dy[] = {0,-1,0,1,-1,1,-1,1};
// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};

const int MOD = 1000000007;
using mint = Fp<MOD>;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(15) << fixed;

    mint ans = 0;
    string n;
    cin >> n;
    ll m = n.size();
    vector<mint> table(m + 1, 0);
    vector<mint> table_2(m + 1, 1);
    rep(i, m) {
        table_2[i + 1] = table_2[i] * 10;
    }
    rep(i, m) {
        table[i + 1] = table[i] + table_2[i] * (i + 1);
    }
    rep(i, m) {
        ll a = n[i] - '0';
        ans += table[m - i - 1] * a + table_2[m - i - 1] * a * i * (i + 1) / 2;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rrep(i, n) for(int i = (int)(n) - 1; i >= 0; i --)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define sll set<ll>
#define spll set<pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod2 998244353
#define inf 1000000000000000000
#define pi acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rsort(a) sort(a.rbegin(), a.rend())
#define print(x) for(auto i : (x)) cout << i << " "; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll dx[] = {-1,0,1,0,-1,-1,1,1};
const ll dy[] = {0,-1,0,1,-1,1,-1,1};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(15) << fixed;

    ll ans = 0;
    string n;
    cin >> n;
    ll m = n.size();
    vll table(n.size() + 1);
    table[0] = 1;
    rep(i, n.size()) {
        table[i + 1] = table[i] * 2;
        table[i + 1] %= mod;
    }
    vll table_2(n.size() + 1);
    table_2[0] = 1;
    rep(i, n.size()) {
        table_2[i + 1] = table_2[i] * 11;
        table_2[i + 1] %= mod;
    }
    rep(i, m) {
        ll a = n[i] - '0';
        if (i != m - 1) ans += a * table_2[m - i - 1];
        ans %= mod;
        if (i != 0) ans += a * pow(10, m - i - 1) * table[i];
        ans %= mod;
        ans += mod;
        ll diff = a * pow(10, m - i - 1) * 2;
        diff %= mod;
        ans -= diff;
        ans %= mod;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rrep(i, n) for(int i = (int)(n) - 1; i >= 0; i --)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define sll set<ll>
#define spll set<pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod2 998244353
#define inf 1000000000000000000
#define pi acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rsort(a) sort(a.rbegin(), a.rend())
#define print(x) for(auto i : (x)) cout << i << " "; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll dx[] = {-1,0,1,0,-1,-1,1,1};
const ll dy[] = {0,-1,0,1,-1,1,-1,1};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(15) << fixed;

    ll ans = 0;
    string n;
    cin >> n;
    ll m = n.size();
    vll table(m + 1, 0);
    vll table_2(m + 1, 1);
    rep(i, m) {
        table_2[i + 1] = table_2[i] * 10;
        table_2[i + 1] %= mod;
    }
    rep(i, m) {
        table[i + 1] = table[i] + (i + 1) * table_2[i];
        table[i + 1] %= mod;
    }
    rep(i, m) {
        ll a = n[i] - '0';
        ans += a * table[m - i - 1];
        ans %= mod;
        ll add = a;
        add *= table_2[m - i - 1];
        add %= mod;
        add *= i;
        add %= mod;
        add *= 1 + i;
        add %= mod;
        add /= 2;
        ans += add;
        ans %= mod;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rrep(i, n) for(int i = (int)(n) - 1; i >= 0; i --)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define sll set<ll>
#define spll set<pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod2 998244353
#define inf 1000000000000000000
#define pi acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rsort(a) sort(a.rbegin(), a.rend())
#define print(x) for(auto i : (x)) cout << i << " "; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll dx[] = {-1,0,1,0,-1,-1,1,1};
const ll dy[] = {0,-1,0,1,-1,1,-1,1};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(15) << fixed;

    ll ans = 0;
    string n;
    cin >> n;
    ll m = n.size();
    vll table(m + 1, 0);
    vll table_2(m + 1, 1);
    rep(i, m) {
        table_2[i + 1] = table_2[i] * 10;
        table_2[i + 1] %= mod;
    }
    rep(i, m) {
        table[i + 1] = table[i] + (i + 1) * table_2[i];
        table[i + 1] %= mod;
    }
    rep(i, m) {
        ll a = n[i] - '0';
        ans += a * table[m - i - 1];
        ans %= mod;
        ans += a * table_2[m - i - 1] * i * (1 + i) / 2;
        ans %= mod;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rrep(i, n) for(int i = (int)(n) - 1; i >= 0; i --)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define sll set<ll>
#define spll set<pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod2 998244353
#define inf 1000000000000000000
#define pi acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rsort(a) sort(a.rbegin(), a.rend())
#define print(x) for(auto i : (x)) cout << i << " "; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll dx[] = {-1,0,1,0,-1,-1,1,1};
const ll dy[] = {0,-1,0,1,-1,1,-1,1};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(15) << fixed;

    ll ans = 0;
    string n;
    cin >> n;
    ll m = n.size();
    vll table(m + 1, 0);
    vll table_2(m + 1, 1);
    rep(i, m) {
        table_2[i + 1] = table_2[i] * 10;
        table_2[i + 1] %= mod;
    }
    rep(i, m) {
        table[i + 1] = table[i] + (i + 1) * table_2[i];
        table[i + 1] %= mod;
    }
    rep(i, m) {
        ll a = n[i] - '0';
        ans += a * table[m - i - 1];
        ans %= mod;
        ll add = (a * table_2[m - i - 1]);
        add %= mod;
        add *= (i + 1) * i / 2;
        add %= mod;
        ans += add;
        ans %= mod;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rrep(i, n) for(int i = (int)(n) - 1; i >= 0; i --)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define sll set<ll>
#define spll set<pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod2 998244353
#define inf 1000000000000000000
#define pi acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rsort(a) sort(a.rbegin(), a.rend())
#define print(x) for(auto i : (x)) cout << i << " "; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll dx[] = {-1,0,1,0,-1,-1,1,1};
const ll dy[] = {0,-1,0,1,-1,1,-1,1};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(15) << fixed;

    ll ans = 0;
    string n;
    cin >> n;
    ll m = n.size();
    vll table(m + 1, 0);
    rep(i, m) {
        table[i + 1] = table[i] + (i + 1) * pow(10, i);
        table[i + 1] %= mod;
    }
    vll table_2(m + 1, 1);
    rep(i, m) {
        table_2[i + 1] = table_2[i] * 10;
        table_2[i + 1] %= mod;
    }
    rep(i, m) {
        ll a = n[i] - '0';
        ans += a * table[m - i - 1];
        ans %= mod;
        ans += a * table_2[m - i - 1] * i * (1 + i) / 2;
        ans %= mod;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rrep(i, n) for(int i = (int)(n) - 1; i >= 0; i --)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define sll set<ll>
#define spll set<pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod2 998244353
#define inf 1000000000000000000
#define pi acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rsort(a) sort(a.rbegin(), a.rend())
#define print(x) for(auto i : (x)) cout << i << " "; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll dx[] = {-1,0,1,0,-1,-1,1,1};
const ll dy[] = {0,-1,0,1,-1,1,-1,1};
// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};

const int MOD = 1000000007;
using mint = Fp<MOD>;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(15) << fixed;

    mint ans = 0;
    string n;
    cin >> n;
    ll m = n.size();
    vll table(m + 1, 0);
    vll table_2(m + 1, 1);
    rep(i, m) {
        table_2[i + 1] = table_2[i] * 10;
        table_2[i + 1] %= mod;
    }
    rep(i, m) {
        table[i + 1] = table[i] + (i + 1) * table_2[i];
        table[i + 1] %= mod;
    }
    rep(i, m) {
        ll a = n[i] - '0';
        ans += a * table[m - i - 1] + (a * table_2[m - i - 1]) * i * (i + 1) / 2;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rrep(i, n) for(int i = (int)(n) - 1; i >= 0; i --)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define sll set<ll>
#define spll set<pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod2 998244353
#define inf 1000000000000000000
#define pi acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rsort(a) sort(a.rbegin(), a.rend())
#define print(x) for(auto i : (x)) cout << i << " "; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll dx[] = {-1,0,1,0,-1,-1,1,1};
const ll dy[] = {0,-1,0,1,-1,1,-1,1};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(15) << fixed;

    ll ans = 0;
    string n;
    cin >> n;
    ll m = n.size();
    vll table(m + 1, 0);
    vll table_2(m + 1, 1);
    rep(i, m) {
        table_2[i + 1] = table_2[i] * 10;
        table_2[i + 1] %= mod;
    }
    rep(i, m) {
        table[i + 1] = table[i] + (i + 1) * table_2[i];
        table[i + 1] %= mod;
    }
    rep(i, m) {
        ll a = n[i] - '0';
        ans += a * table[m - i - 1];
        ans %= mod;
        ll add = (a * table_2[m - i - 1]);
        add %= mod;
        add *= (i + 1);
        add %= mod;
        add *= i;
        add %= mod;
        add /= 2;
        add %= mod;
        ans += add;
        ans %= mod;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>

using namespace std;

// numbers
const int N = 1e5 + 7;
#define MOD 1000000007
#define BMOD 1000000000000000007
#define primemod 998244353
//shortforms
#define ff first
#define ss second
#define ll long long int
#define pb(a) push_back((a))
#define pob() pop_back()
#define all(v) v.begin(),v.end()
//max and min and sum
#define maxv(all,A) *max_element(A.begin(),A.end())
#define maxa(a,i,j,m,p) fof(k,i,j+1){if(a[k]>m){m=a[k];p=k;}}
#define mina(a,i,j,m,p) fof(k,i,j+1){if(a[k]<m){m=a[k];p=k;}}
#define minv(all,A) *min_element(A.begin(),A.end())
#define sumv(all,A,a) accumulate(A.begin(), A.end(),a)
//for loops
#define fof(i,a,n) for(ll i=a;i<(n);i++)
#define fob(i,n,a) for(ll i=n-1;i>=a;i--)
#define fom(i,a,n) for(auto i=a;i!=(n);i++)
//sorting
#define as(all,A) sort((A).begin(),(A).end())
#define ds(all,A,x) sort((A).begin(),(A).end(),greater<x>())
//input
#define input(A,n) fof(i,0,n){cin>>A[i];}
#define mai(n,M,A) fof(i,0,n){ll  ab=A[i]; if(M.find(ab)==M.end()){ M.mk_pair(ll,ll,ab,1); } else { M[ab]++;} }
#define mk_pair(x,y,a,b) insert(pair<x,y >(a,b))
//output
#define in(a) emplace(A.begin(),a)
#define debug(a) cerr<<a<<" ";
#define dispve(A,a,n) fof(i,a,n){cout<<A[i]<<" ";}
#define dismp(m) for(auto x : m){ cout<<x.ff<<" "<<x.ss<<"\n"; }
//code begins
ll power(ll x, ll y, ll p);
void solve()
{
	string s;
	cin>>s;
	deque<ll>a(s.size()),b(s.size(),0),x;
	ll n=s.size();
	fof(i,0,n){
		a[i]=s[i]-'0';
	}
	b[0]=a[0];
	fof(i,1,n){
		b[i]=a[i]+b[i-1];
	}
	x.pb(0);
	fof(i,0,a.size()-1){
		ll u=(((a.size()-(i+1))*(b[i]))%MOD);
		ll y=(a[i+1]*(((i+1)*(i+2))/2))%MOD;
		ll p=(u+y)%MOD;
		//cout<<a[i+1]*((i*(i+1))*0.5)<<' ';
		//cout<<p<<' ';
		x.pb(p);
	}
	//ll c=0;
	//dispve(x,0,x.size());
	/*for(ll i=x.size()-1;i>=0;i--){
		x[i]+=c;
		c=0;
		if(x[i]>9){
			c=x[i]/10;
			x[i]=x[i]%10;
		}
	}*/

	//x.push_front(c);
	ll ans=0;
	for(ll i=x.size()-1;i>=0;i--){
		ans+=(x[i]%MOD)*power(10,x.size()-i-1,MOD);
		ans%=MOD;
	}
	cout<<ans;

}
void template1 ()
{
	ll t;
	cin>>t;
	while(t--)
	{
		solve();
		cout<<"\n";
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//template1();
	solve();cout<<"\n";
	return 0;
}

ll power(ll x, ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}


#include <bits/stdc++.h>

using namespace std;

// numbers
const int N = 1e5 + 7;
#define MOD 1000000007
#define BMOD 1000000000000000007
#define primemod 998244353
//shortforms
#define ff first
#define ss second
#define ll long long int
#define pb(a) push_back((a))
#define pob() pop_back()
#define all(v) v.begin(),v.end()
//max and min and sum
#define maxv(all,A) *max_element(A.begin(),A.end())
#define maxa(a,i,j,m,p) fof(k,i,j+1){if(a[k]>m){m=a[k];p=k;}}
#define mina(a,i,j,m,p) fof(k,i,j+1){if(a[k]<m){m=a[k];p=k;}}
#define minv(all,A) *min_element(A.begin(),A.end())
#define sumv(all,A,a) accumulate(A.begin(), A.end(),a)
//for loops
#define fof(i,a,n) for(auto i=a;i<(n);i++)
#define fob(i,n,a) for(auto i=n-1;i>=a;i--)
#define fom(i,a,n) for(auto i=a;i!=(n);i++)
//sorting
#define as(all,A) sort((A).begin(),(A).end())
#define ds(all,A,x) sort((A).begin(),(A).end(),greater<x>())
//input
#define input(A,n) fof(i,0,n){cin>>A[i];}
#define mai(n,M,A) fof(i,0,n){ll  ab=A[i]; if(M.find(ab)==M.end()){ M.mk_pair(ll,ll,ab,1); } else { M[ab]++;} }
#define mk_pair(x,y,a,b) insert(pair<x,y >(a,b))
//output
#define in(a) emplace(A.begin(),a)
#define debug(a) cerr<<a<<" ";
#define dispve(A,a,n) fof(i,a,n){cout<<A[i]<<" ";}
#define dismp(m) for(auto x : m){ cout<<x.ff<<" "<<x.ss<<"\n"; }
//code begins
ll power(ll x, ll y, ll p);
void solve()
{
	string s;
	cin>>s;
	deque<ll>a(s.size()),b(s.size(),0),x;
	ll n=s.size();
	fof(i,0,n){
		a[i]=s[i]-'0';
	}
	b[0]=a[0];
	fof(i,1,n){
		b[i]=a[i]+b[i-1];
	}
	x.pb(0);
	fof(i,0,a.size()-1){
		ll u=(((a.size()-(i+1))*(b[i]))%MOD);
		ll y=(a[i+1]*(((i+1)*(i+2))/2))%MOD;
		ll p=(u+y)%MOD;
		//cout<<a[i+1]*((i*(i+1))*0.5)<<' ';
		//cout<<p<<' ';
		x.pb(p);
	}
	//ll c=0;
	//dispve(x,0,x.size());
	/*for(ll i=x.size()-1;i>=0;i--){
		x[i]+=c;
		c=0;
		if(x[i]>9){
			c=x[i]/10;
			x[i]=x[i]%10;
		}
	}*/

	//x.push_front(c);
	ll ans=0;
	for(ll i=x.size()-1;i>=0;i--){
		ans+=(x[i]%MOD)*power(10,x.size()-i-1,MOD);
		ans%=MOD;
	}
	cout<<ans;

}
void template1 ()
{
	ll t;
	cin>>t;
	while(t--)
	{
		solve();
		cout<<"\n";
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//template1();
	solve();cout<<"\n";
	return 0;
}

ll power(ll x, ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}


#include <bits/stdc++.h>

using namespace std;

// numbers
const int N = 1e5 + 7;
#define MOD 1000000007
#define BMOD 1000000000000000007
#define primemod 998244353
//shortforms
#define ff first
#define ss second
#define ll long long int
#define pb(a) push_back((a))
#define pob() pop_back()
#define all(v) v.begin(),v.end()
//max and min and sum
#define maxv(all,A) *max_element(A.begin(),A.end())
#define maxa(a,i,j,m,p) fof(k,i,j+1){if(a[k]>m){m=a[k];p=k;}}
#define mina(a,i,j,m,p) fof(k,i,j+1){if(a[k]<m){m=a[k];p=k;}}
#define minv(all,A) *min_element(A.begin(),A.end())
#define sumv(all,A,a) accumulate(A.begin(), A.end(),a)
//for loops
#define fof(i,a,n) for(auto i=a;i<(n);i++)
#define fob(i,n,a) for(auto i=n-1;i>=a;i--)
#define fom(i,a,n) for(auto i=a;i!=(n);i++)
//sorting
#define as(all,A) sort((A).begin(),(A).end())
#define ds(all,A,x) sort((A).begin(),(A).end(),greater<x>())
//input
#define input(A,n) fof(i,0,n){cin>>A[i];}
#define mai(n,M,A) fof(i,0,n){ll  ab=A[i]; if(M.find(ab)==M.end()){ M.mk_pair(ll,ll,ab,1); } else { M[ab]++;} }
#define mk_pair(x,y,a,b) insert(pair<x,y >(a,b))
//output
#define in(a) emplace(A.begin(),a)
#define debug(a) cerr<<a<<" ";
#define dispve(A,a,n) fof(i,a,n){cout<<A[i]<<" ";}
#define dismp(m) for(auto x : m){ cout<<x.ff<<" "<<x.ss<<"\n"; }
//code begins
ll power(ll x, ll y, ll p);
void solve()
{
	string s;
	cin>>s;
	deque<ll>a(s.size()),b(s.size(),0),x;
	ll n=s.size();
	fof(i,0,n){
		a[i]=s[i]-'0';
	}
	b[0]=a[0];
	fof(i,1,n){
		b[i]=a[i]+b[i-1];
	}
	fof(i,0,a.size()-1){
		ll p=(a.size()-(i+1))*(b[i])+a[i+1]*(((i+1)*(i+2))*0.5);
		//cout<<a[i+1]*((i*(i+1))*0.5)<<' ';
		//cout<<p<<' ';
		x.pb(p);
	}
	ll c=0;
	//dispve(x,0,x.size());
	for(ll i=x.size()-1;i>=0;i--){
		x[i]+=c;
		c=0;
		if(x[i]>9){
			c=x[i]/10;
			x[i]=x[i]%10;
		}
	}

	x.push_front(c);
	ll ans=0;
	for(ll i=x.size()-1;i>=0;i--){
		ans+=x[i]*power(10,x.size()-i-1,MOD);
		ans%=MOD;
	}
	cout<<ans;

}
void template1 ()
{
	ll t;
	cin>>t;
	while(t--)
	{
		solve();
		cout<<"\n";
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//template1();
	solve();cout<<"\n";
	return 0;
}

ll power(ll x, ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}


#include <bits/stdc++.h>

using namespace std;

// numbers
const int N = 1e5 + 7;
#define MOD 1000000007
#define BMOD 1000000000000000007
#define primemod 998244353
//shortforms
#define ff first
#define ss second
#define ll long long int
#define pb(a) push_back((a))
#define pob() pop_back()
#define all(v) v.begin(),v.end()
//max and min and sum
#define maxv(all,A) *max_element(A.begin(),A.end())
#define maxa(a,i,j,m,p) fof(k,i,j+1){if(a[k]>m){m=a[k];p=k;}}
#define mina(a,i,j,m,p) fof(k,i,j+1){if(a[k]<m){m=a[k];p=k;}}
#define minv(all,A) *min_element(A.begin(),A.end())
#define sumv(all,A,a) accumulate(A.begin(), A.end(),a)
//for loops
#define fof(i,a,n) for(ll i=a;i<(n);i++)
#define fob(i,n,a) for(ll i=n-1;i>=a;i--)
#define fom(i,a,n) for(auto i=a;i!=(n);i++)
//sorting
#define as(all,A) sort((A).begin(),(A).end())
#define ds(all,A,x) sort((A).begin(),(A).end(),greater<x>())
//input
#define input(A,n) fof(i,0,n){cin>>A[i];}
#define mai(n,M,A) fof(i,0,n){ll  ab=A[i]; if(M.find(ab)==M.end()){ M.mk_pair(ll,ll,ab,1); } else { M[ab]++;} }
#define mk_pair(x,y,a,b) insert(pair<x,y >(a,b))
//output
#define in(a) emplace(A.begin(),a)
#define debug(a) cerr<<a<<" ";
#define dispve(A,a,n) fof(i,a,n){cout<<A[i]<<" ";}
#define dismp(m) for(auto x : m){ cout<<x.ff<<" "<<x.ss<<"\n"; }
//code begins
ll power(ll x, ll y, ll p);
void solve()
{
	string s;
	cin>>s;
	deque<ll>a(s.size()),b(s.size(),0),x;
	ll n=s.size();
	fof(i,0,n){
		a[i]=s[i]-'0';
	}
	b[0]=a[0];
	fof(i,1,n){
		b[i]=a[i]+b[i-1];
	}
	x.pb(0);
	fof(i,0,a.size()-1){
		ll u=(((a.size()-(i+1))*(b[i]))%MOD);
		ll y=(a[i+1]*(((i+1)*(i+2))/2))%MOD;
		ll p=(u+y)%MOD;
		x.pb(p);
	}
	ll ans=0;
	for(ll i=x.size()-1;i>=0;i--){
		ans+=(x[i]%MOD)*power(10,x.size()-i-1,MOD);
		ans%=MOD;
	}
	cout<<ans;
}
void template1 ()
{
	ll t;
	cin>>t;
	while(t--)
	{
		solve();
		cout<<"\n";
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//template1();
	solve();cout<<"\n";
	return 0;
}

ll power(ll x, ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}


#include <bits/stdc++.h>

using namespace std;

// numbers
const int N = 1e5 + 7;
#define MOD 1000000007
#define BMOD 1000000000000000007
#define primemod 998244353
//shortforms
#define ff first
#define ss second
#define ll long long int
#define pb(a) push_back((a))
#define pob() pop_back()
#define all(v) v.begin(),v.end()
//max and min and sum
#define maxv(all,A) *max_element(A.begin(),A.end())
#define maxa(a,i,j,m,p) fof(k,i,j+1){if(a[k]>m){m=a[k];p=k;}}
#define mina(a,i,j,m,p) fof(k,i,j+1){if(a[k]<m){m=a[k];p=k;}}
#define minv(all,A) *min_element(A.begin(),A.end())
#define sumv(all,A,a) accumulate(A.begin(), A.end(),a)
//for loops
#define fof(i,a,n) for(auto i=a;i<(n);i++)
#define fob(i,n,a) for(auto i=n-1;i>=a;i--)
#define fom(i,a,n) for(auto i=a;i!=(n);i++)
//sorting
#define as(all,A) sort((A).begin(),(A).end())
#define ds(all,A,x) sort((A).begin(),(A).end(),greater<x>())
//input
#define input(A,n) fof(i,0,n){cin>>A[i];}
#define mai(n,M,A) fof(i,0,n){ll  ab=A[i]; if(M.find(ab)==M.end()){ M.mk_pair(ll,ll,ab,1); } else { M[ab]++;} }
#define mk_pair(x,y,a,b) insert(pair<x,y >(a,b))
//output
#define in(a) emplace(A.begin(),a)
#define debug(a) cerr<<a<<" ";
#define dispve(A,a,n) fof(i,a,n){cout<<A[i]<<" ";}
#define dismp(m) for(auto x : m){ cout<<x.ff<<" "<<x.ss<<"\n"; }
//code begins
ll power(ll x, ll y, ll p);
void solve()
{
	string s;
	cin>>s;
	deque<ll>a(s.size()),b(s.size(),0),x;
	ll n=s.size();
	fof(i,0,n){
		a[i]=s[i]-'0';
	}
	b[0]=a[0];
	fof(i,1,n){
		b[i]=a[i]+b[i-1];
	}
	x.pb(0);
	fof(i,0,a.size()-1){
		ll p=((a.size()-(i+1))*(b[i]))+a[i+1]*(((i+1)*(i+2))*0.5);
		//cout<<a[i+1]*((i*(i+1))*0.5)<<' ';
		//cout<<p<<' ';
		x.pb(p%MOD);
	}
	//ll c=0;
	//dispve(x,0,x.size());
	/*for(ll i=x.size()-1;i>=0;i--){
		x[i]+=c;
		c=0;
		if(x[i]>9){
			c=x[i]/10;
			x[i]=x[i]%10;
		}
	}*/

	//x.push_front(c);
	ll ans=0;
	for(ll i=x.size()-1;i>=0;i--){
		ans+=(x[i]%MOD)*power(10,x.size()-i-1,MOD);
		ans%=MOD;
	}
	cout<<ans;

}
void template1 ()
{
	ll t;
	cin>>t;
	while(t--)
	{
		solve();
		cout<<"\n";
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//template1();
	solve();cout<<"\n";
	return 0;
}

ll power(ll x, ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}


#include <bits/stdc++.h>

using namespace std;

// numbers
const int N = 1e5 + 7;
#define MOD 1000000007
#define BMOD 1000000000000000007
#define primemod 998244353
//shortforms
#define ff first
#define ss second
#define ll long long int
#define pb(a) push_back((a))
#define pob() pop_back()
#define all(v) v.begin(),v.end()
//max and min and sum
#define maxv(all,A) *max_element(A.begin(),A.end())
#define maxa(a,i,j,m,p) fof(k,i,j+1){if(a[k]>m){m=a[k];p=k;}}
#define mina(a,i,j,m,p) fof(k,i,j+1){if(a[k]<m){m=a[k];p=k;}}
#define minv(all,A) *min_element(A.begin(),A.end())
#define sumv(all,A,a) accumulate(A.begin(), A.end(),a)
//for loops
#define fof(i,a,n) for(auto i=a;i<(n);i++)
#define fob(i,n,a) for(auto i=n-1;i>=a;i--)
#define fom(i,a,n) for(auto i=a;i!=(n);i++)
//sorting
#define as(all,A) sort((A).begin(),(A).end())
#define ds(all,A,x) sort((A).begin(),(A).end(),greater<x>())
//input
#define input(A,n) fof(i,0,n){cin>>A[i];}
#define mai(n,M,A) fof(i,0,n){ll  ab=A[i]; if(M.find(ab)==M.end()){ M.mk_pair(ll,ll,ab,1); } else { M[ab]++;} }
#define mk_pair(x,y,a,b) insert(pair<x,y >(a,b))
//output
#define in(a) emplace(A.begin(),a)
#define debug(a) cerr<<a<<" ";
#define dispve(A,a,n) fof(i,a,n){cout<<A[i]<<" ";}
#define dismp(m) for(auto x : m){ cout<<x.ff<<" "<<x.ss<<"\n"; }
//code begins
ll power(ll x, ll y, ll p);
void solve()
{
	string s;
	cin>>s;
	deque<ll>a(s.size()),b(s.size(),0),x;
	ll n=s.size();
	fof(i,0,n){
		a[i]=s[i]-'0';
	}
	b[0]=a[0];
	fof(i,1,n){
		b[i]=a[i]+b[i-1];
	}
	x.pb(0);
	fof(i,0,a.size()-1){
		ll p=((((a.size()-(i+1))*(b[i]))%MOD)+(a[i+1]*(((i+1)*(i+2))/2))%MOD);
		//cout<<a[i+1]*((i*(i+1))*0.5)<<' ';
		//cout<<p<<' ';
		x.pb(p);
	}
	//ll c=0;
	//dispve(x,0,x.size());
	/*for(ll i=x.size()-1;i>=0;i--){
		x[i]+=c;
		c=0;
		if(x[i]>9){
			c=x[i]/10;
			x[i]=x[i]%10;
		}
	}*/

	//x.push_front(c);
	ll ans=0;
	for(ll i=x.size()-1;i>=0;i--){
		ans+=(x[i]%MOD)*power(10,x.size()-i-1,MOD);
		ans%=MOD;
	}
	cout<<ans;

}
void template1 ()
{
	ll t;
	cin>>t;
	while(t--)
	{
		solve();
		cout<<"\n";
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//template1();
	solve();cout<<"\n";
	return 0;
}

ll power(ll x, ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}


#include <bits/stdc++.h>

using namespace std;

// numbers
const int N = 1e5 + 7;
#define MOD 1000000007
#define BMOD 1000000000000000007
#define primemod 998244353
//shortforms
#define ff first
#define ss second
#define ll long long int
#define pb(a) push_back((a))
#define pob() pop_back()
#define all(v) v.begin(),v.end()
//max and min and sum
#define maxv(all,A) *max_element(A.begin(),A.end())
#define maxa(a,i,j,m,p) fof(k,i,j+1){if(a[k]>m){m=a[k];p=k;}}
#define mina(a,i,j,m,p) fof(k,i,j+1){if(a[k]<m){m=a[k];p=k;}}
#define minv(all,A) *min_element(A.begin(),A.end())
#define sumv(all,A,a) accumulate(A.begin(), A.end(),a)
//for loops
#define fof(i,a,n) for(auto i=a;i<(n);i++)
#define fob(i,n,a) for(auto i=n-1;i>=a;i--)
#define fom(i,a,n) for(auto i=a;i!=(n);i++)
//sorting
#define as(all,A) sort((A).begin(),(A).end())
#define ds(all,A,x) sort((A).begin(),(A).end(),greater<x>())
//input
#define input(A,n) fof(i,0,n){cin>>A[i];}
#define mai(n,M,A) fof(i,0,n){ll  ab=A[i]; if(M.find(ab)==M.end()){ M.mk_pair(ll,ll,ab,1); } else { M[ab]++;} }
#define mk_pair(x,y,a,b) insert(pair<x,y >(a,b))
//output
#define in(a) emplace(A.begin(),a)
#define debug(a) cerr<<a<<" ";
#define dispve(A,a,n) fof(i,a,n){cout<<A[i]<<" ";}
#define dismp(m) for(auto x : m){ cout<<x.ff<<" "<<x.ss<<"\n"; }
//code begins
ll power(ll x, ll y, ll p);
void solve()
{
	string s;
	cin>>s;
	deque<ll>a(s.size()),b(s.size(),0),x;
	ll n=s.size();
	fof(i,0,n){
		a[i]=s[i]-'0';
	}
	b[0]=a[0];
	fof(i,1,n){
		b[i]=a[i]+b[i-1];
	}
	x.pb(0);
	fof(i,0,a.size()-1){
		ll p=(a.size()-(i+1))*(b[i])+a[i+1]*(((i+1)*(i+2))*0.5);
		//cout<<a[i+1]*((i*(i+1))*0.5)<<' ';
		//cout<<p<<' ';
		x.pb(p);
	}
	ll c=0;
	//dispve(x,0,x.size());
	for(ll i=x.size()-1;i>=0;i--){
		x[i]+=c;
		c=0;
		if(x[i]>9){
			c=x[i]/10;
			x[i]=x[i]%10;
		}
	}

	x.push_front(c);
	ll ans=0;
	for(ll i=x.size()-1;i>=0;i--){
		ans+=x[i]*power(10,x.size()-i-1,MOD);
		ans%=MOD;
	}
	cout<<ans;

}
void template1 ()
{
	ll t;
	cin>>t;
	while(t--)
	{
		solve();
		cout<<"\n";
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//template1();
	solve();cout<<"\n";
	return 0;
}

ll power(ll x, ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}


#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 s;
    cin >> s;

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

    const int MOD = (int)1e+9 + 7;

    ll ans = 0;
    ll sum = 0;
    ll p = 1;

    for (ll i = n - 1; i >= 0; --i) {
        ll k = (i * (i + 1) / 2 % MOD * p % MOD + sum) % MOD;
        sum = (sum + p * (n - i) % MOD) % MOD;
        p = p * 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  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 % 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 = (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

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;
        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 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;
        s %= mod;
        f += 1;
        d *= 10;
        d %= mod;
    }
    cout << ans % mod << endl;
}