#include <bits/stdc++.h>

#define x first
#define y second
#define y1 Y1
#define y2 Y2
#define mp make_pair
#define pb push_back
#define DEBUG(x) cout << #x << " = " << x << endl;

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

template <typename T> inline int Chkmax (T &a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> inline int Chkmin (T &a, T b) { return a > b ? a = b, 1 : 0; }
template <typename T> inline T read ()
{
	T sum = 0, fl = 1; char ch = getchar();
	for (; !isdigit(ch); ch = getchar()) if (ch == '-') fl = -1;
	for (; isdigit(ch); ch = getchar()) sum = (sum << 3) + (sum << 1) + ch - '0';
	return sum * fl;
}

inline void proc_status ()
{
	ifstream t ("/proc/self/status");
	cerr << string (istreambuf_iterator <char> (t), istreambuf_iterator <char> ()) << endl;
}

const int Maxn = 3e7 + 100;
const int Mod = 1e9 + 7;

int N = 1e7, M = 3e7;
int S, Len[Maxn], ans;

inline void Add (int &a, int b) { if ((a += b) >= Mod) a -= Mod; }

inline int Pow (int a, int b)
{
	int ans = 1;
	for (int i = b; i; i >>= 1, a = (LL) a * a % Mod) if (i & 1) ans = (LL) ans * a % Mod;
	return ans;
}

inline void Calc1 ()
{
	int r = 0, sum = 0;
	for (int l = 1; l < N; ++l)
	{
		while (sum < S) sum += Len[++r];
		if (sum == S) ++ans;
		sum -= Len[l];
	}
}

inline void Calc2 ()
{
	for (int i = 1; i <= S / 8; ++i)
		if (!(S % i)) Add (ans, ((LL) Pow (10, S / i - 1) * 9 % Mod - i + 1 + Mod) % Mod);
		else Add (ans, 1);
}

inline void Solve ()
{
	for (int i = 1; i <= M; ++i) Len[i] = Len[i / 10] + 1;

	Calc1 ();
	Calc2 ();
	cout << ans << endl;
}

inline void Input ()
{
	S = read<int>();
}

int main()
{

#ifdef hk_cnyali
	freopen("F.in", "r", stdin);
	freopen("F.out", "w", stdout);
#endif

	Input ();
	Solve ();

	return 0;
}

### Prompt

In Cpp, your task is to solve the following problem:

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 x first
#define y second
#define y1 Y1
#define y2 Y2
#define mp make_pair
#define pb push_back
#define DEBUG(x) cout << #x << " = " << x << endl;

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

template <typename T> inline int Chkmax (T &a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> inline int Chkmin (T &a, T b) { return a > b ? a = b, 1 : 0; }
template <typename T> inline T read ()
{
	T sum = 0, fl = 1; char ch = getchar();
	for (; !isdigit(ch); ch = getchar()) if (ch == '-') fl = -1;
	for (; isdigit(ch); ch = getchar()) sum = (sum << 3) + (sum << 1) + ch - '0';
	return sum * fl;
}

inline void proc_status ()
{
	ifstream t ("/proc/self/status");
	cerr << string (istreambuf_iterator <char> (t), istreambuf_iterator <char> ()) << endl;
}

const int Maxn = 3e7 + 100;
const int Mod = 1e9 + 7;

int N = 1e7, M = 3e7;
int S, Len[Maxn], ans;

inline void Add (int &a, int b) { if ((a += b) >= Mod) a -= Mod; }

inline int Pow (int a, int b)
{
	int ans = 1;
	for (int i = b; i; i >>= 1, a = (LL) a * a % Mod) if (i & 1) ans = (LL) ans * a % Mod;
	return ans;
}

inline void Calc1 ()
{
	int r = 0, sum = 0;
	for (int l = 1; l < N; ++l)
	{
		while (sum < S) sum += Len[++r];
		if (sum == S) ++ans;
		sum -= Len[l];
	}
}

inline void Calc2 ()
{
	for (int i = 1; i <= S / 8; ++i)
		if (!(S % i)) Add (ans, ((LL) Pow (10, S / i - 1) * 9 % Mod - i + 1 + Mod) % Mod);
		else Add (ans, 1);
}

inline void Solve ()
{
	for (int i = 1; i <= M; ++i) Len[i] = Len[i / 10] + 1;

	Calc1 ();
	Calc2 ();
	cout << ans << endl;
}

inline void Input ()
{
	S = read<int>();
}

int main()
{

#ifdef hk_cnyali
	freopen("F.in", "r", stdin);
	freopen("F.out", "w", stdout);
#endif

	Input ();
	Solve ();

	return 0;
}

```