program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: ans, a, n,i, md=1000000007
    integer(int64),allocatable:: a8(:), frac(:), ifrac(:)

    read*, n
    if (n==1) then
        print'(i0)', 0
        stop
    end if

    allocate(a8(0:n))
    allocate(frac(0:n), ifrac(0:n))

    frac(0)=1; ifrac(0)=1
    do i=1,n
        frac(i) = mod(frac(i-1)*i,md)
        ifrac(i) = inv(frac(i),md)
    end do



    a8(1) = 8

    do i=2,n
        a8(i)=mod(a8(i-1)*8, md)
    end do


    ans = 0
    do i=1,n
        a = mod(factorial(8_8,n-i,md)*comb(n,i,md),md)
        ans=mod(ans+a,md)
    end do

    print'(i0)', modulo(factorial(10_8,n,md) - ans*2 - factorial(8_8,n,md), md)
contains
! frac, ifrac, md を用意!
function comb(a,b,md) result(ret)
    integer(int64):: a,b,md
    integer(int64):: ret
    ret = mod(mod(frac(a)*ifrac(b),md)*ifrac(a-b),md)
end function

function inv(x,md) result(ret)
    integer(int64),intent(in):: x,md
    integer(int64):: ret
    ret = factorial(x,md-2,md)
end function

function factorial(a,b,md) result(ret)
    integer(int64):: a,b,md
    integer(int64):: aa,bb,ret
    aa = a
    bb = b
    ret = 1
    do while(bb > 0)
        if (mod(bb,2_8)/=0) ret=mod(ret*aa,md)
        aa=mod(aa*aa,md)
        bb=bb/2
    end do
end function
end program main