import algorithm, future, hashes, macros, math, sequtils, sets, strutils, tables, unicode template readString: string = stdin.readLine template readStrings: seq[string] = stdin.readLine.split template readInt: int = stdin.readLine.parseInt template readInts: seq[int] = readLine(stdin).split(" ").map(parseInt) template readFloat: float = stdin.readLine.parseFloat template readFloats: seq[float] = stdin.readLine.split.map(parseFloat) template times(n: int, body: untyped): untyped = (for _ in 0.. 0: if (n and 1) == 1: result = result * a mod P a = a * a mod P n = n shr 1 return result const P = 10 ^ 9 + 7 var N = readInt var res = ((((4 * modPow(10, N, P) mod P) - 1 + P) mod P) * modPow(3, P - 2, P)) mod P echo res