Language: C++

#define DEBUG 0
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<class T>using numr=std::numeric_limits<T>;
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 int INF = 1e9;
const ll LLINF = 1e16;
const int mod = 1000000007;
const int mod2 = 998244353;
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { std::cerr << " " << head; debug_impl(tail...); }
#if DEBUG
#define debug(...)\
    do {\
        std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
        debug_impl(__VA_ARGS__);\
        std::cerr << std::noboolalpha;\
    } while (false)
#else
#define debug(...) {}
#endif

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr>
std::istream& operator>> (std::istream& is, Container& v)
    { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr >
std::ostream& operator<< (std::ostream& os, Container const& v) {
os << "{";
    for (auto it = v.begin(); it != v.end(); it++)
        {os << (it != v.begin() ? "," : "") << *it;}
    return os << "}";
}

template< typename T >
T mod_pow(T x, T n, const T &p) {
  T ret = 1;
  while(n > 0) {
    if(n & 1) (ret *= x) %= p;
    (x *= x) %= p;
    n >>= 1;
  }
  return ret;
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    ll all = mod_pow(10,n,mod);
    ll zero = all - mod_pow(9,n,mod);
    ll nine = all - mod_pow(9,n,mod);
    cout << zero + nine + mod_pow(8,n,mod) - all << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:21: error: no matching function for call to 'mod_pow(int, ll&, const int&)'
   61 |     ll all = mod_pow(10,n,mod);
      |              ~~~~~~~^~~~~~~~~~
a.cc:46:3: note: candidate: 'template<class T> T mod_pow(T, T, const T&)'
   46 | T mod_pow(T x, T n, const T &p) {
      |   ^~~~~~~
a.cc:46:3: note:   template argument deduction/substitution failed:
a.cc:61:21: note:   deduced conflicting types for parameter 'T' ('int' and 'long long int')
   61 |     ll all = mod_pow(10,n,mod);
      |              ~~~~~~~^~~~~~~~~~
a.cc:62:28: error: no matching function for call to 'mod_pow(int, ll&, const int&)'
   62 |     ll zero = all - mod_pow(9,n,mod);
      |                     ~~~~~~~^~~~~~~~~
a.cc:46:3: note: candidate: 'template<class T> T mod_pow(T, T, const T&)'
   46 | T mod_pow(T x, T n, const T &p) {
      |   ^~~~~~~
a.cc:46:3: note:   template argument deduction/substitution failed:
a.cc:62:28: note:   deduced conflicting types for parameter 'T' ('int' and 'long long int')
   62 |     ll zero = all - mod_pow(9,n,mod);
      |                     ~~~~~~~^~~~~~~~~
a.cc:63:28: error: no matching function for call to 'mod_pow(int, ll&, const int&)'
   63 |     ll nine = all - mod_pow(9,n,mod);
      |                     ~~~~~~~^~~~~~~~~
a.cc:46:3: note: candidate: 'template<class T> T mod_pow(T, T, const T&)'
   46 | T mod_pow(T x, T n, const T &p) {
      |   ^~~~~~~
a.cc:46:3: note:   template argument deduction/substitution failed:
a.cc:63:28: note:   deduced conflicting types for parameter 'T' ('int' and 'long long int')
   63 |     ll nine = all - mod_pow(9,n,mod);
      |                     ~~~~~~~^~~~~~~~~
a.cc:64:34: error: no matching function for call to 'mod_pow(int, ll&, const int&)'
   64 |     cout << zero + nine + mod_pow(8,n,mod) - all << endl;
      |                           ~~~~~~~^~~~~~~~~
a.cc:46:3: note: candidate: 'template<class T> T mod_pow(T, T, const T&)'
   46 | T mod_pow(T x, T n, const T &p) {
      |   ^~~~~~~
a.cc:46:3: note:   template argument deduction/substitution failed:
a.cc:64:34: note:   deduced conflicting types for parameter 'T' ('int' and 'long long int')
   64 |     cout << zero + nine + mod_pow(8,n,mod) - all << endl;
      |                           ~~~~~~~^~~~~~~~~