package main import ( "bufio" "fmt" "os" "sort" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var wr = bufio.NewWriter(os.Stdout) func out(x ...interface{}) { fmt.Fprintln(wr, x...) } func getI() int { sc.Scan() i, e := strconv.Atoi(sc.Text()) if e != nil { panic(e) } return i } func getF() float64 { sc.Scan() i, e := strconv.ParseFloat(sc.Text(), 64) if e != nil { panic(e) } return i } func getInts(N int) []int { ret := make([]int, N) for i := 0; i < N; i++ { ret[i] = getI() } return ret } func getS() string { sc.Scan() return sc.Text() } // min, max, asub, absなど基本関数 func max(a, b int) int { if a > b { return a } return b } func min(a, b int) int { if a < b { return a } return b } func asub(a, b int) int { if a > b { return a - b } return b - a } func abs(a int) int { if a >= 0 { return a } return -a } func lowerBound(a []int, x int) int { idx := sort.Search(len(a), func(i int) bool { return a[i] >= x }) return idx } func upperBound(a []int, x int) int { idx := sort.Search(len(a), func(i int) bool { return a[i] > x }) return idx } //---------------------------------------- // modint //---------------------------------------- type modint struct { mod int fracMemo []int ifracMemo []int } func newModint(m int) *modint { var ret modint ret.mod = m ret.fracMemo = []int{1, 1} ret.ifracMemo = []int{1, 1} return &ret } func (m *modint) add(a, b int) int { ret := (a + b) % m.mod if ret < 0 { ret += m.mod } return ret } func (m *modint) sub(a, b int) int { ret := (a - b) % m.mod if ret < 0 { ret += m.mod } return ret } func (m *modint) mul(a, b int) int { ret := a * b % m.mod if ret < 0 { ret += m.mod } return ret } func (m *modint) div(a, b int) int { ret := a * m.modinv(b) ret %= m.mod return ret } func (m *modint) pow(p, n int) int { ret := 1 x := p for n != 0 { if n%2 == 1 { ret *= x ret %= m.mod } n /= 2 x = x * x % m.mod } return ret } // 逆元を使った割り算(MOD) // mod. m での a の逆元 a^{-1} を計算する func (m *modint) modinv(a int) int { b := m.mod u := 1 v := 0 for b != 0 { t := a / b a -= t * b a, b = b, a u -= t * v u, v = v, u } u %= m.mod if u < 0 { u += m.mod } return u } func main() { defer wr.Flush() sc.Split(bufio.ScanWords) sc.Buffer([]byte{}, 1000000) // this template is new version. // use getI(), getS(), getInts(), getF() N := getI() mod := newModint(1e9 + 7) n := mod.pow(10, N) ans := mod.div(mod.sub(n, 1), 3) ans = mod.add(ans, n) out(ans) }