#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long d[100]; int main() { d[0] = 3; long long now = 10; for (int i = 1; i < 100; i++) { d[i] = d[i - 1] * (now + 1) % 1000000007; now = now * now % 1000000007; } long long k; cin >> k; long long ans = 1; now = 10; int n = 0; while (k > 0) { if (k & 1) { ans = ans * now % 1000000007; ans += d[n]; ans %= 1000000007; } n++; k = k >> 1; now = now * now % 1000000007; } cout << ans << endl; return 0; }