//              _      _                 
//             (_)    | |                
//    _ __ ___  _  ___| |__   __ _  ___  
//   | '_ ` _ \| |/ __| '_ \ / _` |/ _ \ 
//   | | | | | | | (__| | | | (_| | (_) |
//   |_| |_| |_|_|\___|_| |_|\__,_|\___/ 
//                                       
// 
#include <bits/stdc++.h>
#define int long long
#define mp make_pair
#define pb push_back
#define ld long double
#define pii pair<int,int>
#define sz(x) (int)x.size()
#define piii pair<pii,pii>
#define precise cout<<fixed<<setprecision(10)
#define st first
#define nd second
#define ins insert
#define vi vector<int>
#define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
/*
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/
using namespace std;
const int mod=1e9+7;
int ans,s;
int dig(int n)
{
	int ile=0;
	while (n)n/=10,ile++;
	return ile;
}

int fastpow(int a,int b)
{
	int wynik=1;
	while (b)
	{
		if (b&1)wynik=(wynik*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return wynik;
}

int get(int x)
{
	return (fastpow(10,s/x)-fastpow(10,s/x-1)-x+1+mod*3)%mod;
}
int32_t main()
{
  BOOST;
  cin>>s;
  int sum=0;
  int wskaz=1;
  for (int i=1;i<10000000;i++)
  {
  	while (sum<s)sum+=dig(wskaz),wskaz++;
  	if (sum==s)ans++;
  	sum-=dig(i);
  }
  ans+=s/8;
  for (int i=1;i<=s/8;i++)
  	if (s%i==0)
  	{
  		ans=(ans+get(i))%mod;
  		ans--;
  		if (ans<0)ans+=mod;
  	}
  cout<<ans;
  return 0;
}

### Prompt

Please provide a cpp coded solution to the problem described below:

For a positive integer n, let us define f(n) as the number of digits in base 10.

You are given an integer S. Count the number of the pairs of positive integers (l, r) (l \leq r) such that f(l) + f(l + 1) + ... + f(r) = S, and find the count modulo 10^9 + 7.

Constraints

* 1 \leq S \leq 10^8

Input

Input is given from Standard Input in the following format:


S


Output

Print the answer.

Examples

Input

1


Output

9


Input

2


Output

98


Input

123


Output

460191684


Input

36018


Output

966522825


Input

1000


Output

184984484

### Response

```cpp
//              _      _                 
//             (_)    | |                
//    _ __ ___  _  ___| |__   __ _  ___  
//   | '_ ` _ \| |/ __| '_ \ / _` |/ _ \ 
//   | | | | | | | (__| | | | (_| | (_) |
//   |_| |_| |_|_|\___|_| |_|\__,_|\___/ 
//                                       
// 
#include <bits/stdc++.h>
#define int long long
#define mp make_pair
#define pb push_back
#define ld long double
#define pii pair<int,int>
#define sz(x) (int)x.size()
#define piii pair<pii,pii>
#define precise cout<<fixed<<setprecision(10)
#define st first
#define nd second
#define ins insert
#define vi vector<int>
#define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
/*
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/
using namespace std;
const int mod=1e9+7;
int ans,s;
int dig(int n)
{
	int ile=0;
	while (n)n/=10,ile++;
	return ile;
}

int fastpow(int a,int b)
{
	int wynik=1;
	while (b)
	{
		if (b&1)wynik=(wynik*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return wynik;
}

int get(int x)
{
	return (fastpow(10,s/x)-fastpow(10,s/x-1)-x+1+mod*3)%mod;
}
int32_t main()
{
  BOOST;
  cin>>s;
  int sum=0;
  int wskaz=1;
  for (int i=1;i<10000000;i++)
  {
  	while (sum<s)sum+=dig(wskaz),wskaz++;
  	if (sum==s)ans++;
  	sum-=dig(i);
  }
  ans+=s/8;
  for (int i=1;i<=s/8;i++)
  	if (s%i==0)
  	{
  		ans=(ans+get(i))%mod;
  		ans--;
  		if (ans<0)ans+=mod;
  	}
  cout<<ans;
  return 0;
}

```