import cmath import sys from collections import deque, defaultdict from heapq import heappop,heappush from copy import deepcopy INF=10**18 MOD=10**9+7 MAX=10**5+7 def f(n): if n==0: return 0 res=0 if n&1: res+=pow(10, n-1, MOD) res%=MOD t=f(n//2) res+=(pow(10, n//2, MOD)*t+t)%MOD res%=MOD return res def main(): N=int(input()) ans=(pow(10, N, MOD)+f(N)*3)%MOD print(ans) if __name__=='__main__': main()