Problem:
Score : 300 points

Problem Statement

How many integer sequences A_1,A_2,\ldots,A_N of length N satisfy all of the following conditions?

0 \leq A_i \leq 9

There exists some i such that A_i=0 holds.

There exists some i such that A_i=9 holds.

The answer can be very large, so output it modulo 10^9 + 7.

Constraints

1 \leq N \leq 10^6

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer modulo 10^9 + 7.

Sample Input 1

2

Sample Output 1

2

Two sequences \{0,9\} and \{9,0\} satisfy all conditions.

Sample Input 2

1

Sample Output 2

0

Sample Input 3

869121

Sample Output 3

2511445

Solution in Ruby (2.7.1) (judge verdict: Accepted)

class InputLine
  def self.to_s
    gets.chomp
  end

  def self.to_i
    InputLine.to_s.to_i
  end
  
  def self.to_f
    InputLine.to_s.to_f
  end

  def self.to_sa
    InputLine.to_s.split(' ')
  end

  def self.to_ia
    InputLine.to_sa.map(&:to_i)
  end
  
  def self.to_fa
    InputLine.to_sa.map(&:to_f)
  end
end

MOD = 1000000007

def binpow_mod(b, e)
  return 1       if e <= 0
  return b % MOD if e == 1

  p = binpow_mod(b, e >> 1)
  q = (p * p) % MOD
  q = (q * b) % MOD if (e % 2) == 1
  return q
end

def solve(n)
  a = binpow_mod(10, n)
  b = binpow_mod(9,  n)
  c = binpow_mod(8,  n)

  x = (2 * (a + MOD - b)) % MOD
  y = ((a + MOD) - c) % MOD
  return ((x + MOD) - y) % MOD
end

def main(argv)
  n = InputLine.to_i

  puts solve(n).to_s
end

if self.to_s == 'main' then
  main(ARGV)
end