open System open System.Numerics let mutable n = stdin.ReadLine () |> int64 let mutable s = "1" if n > int64 Int32.MaxValue then s <- s + String.replicate Int32.MaxValue "3" n <- n - int64 Int32.MaxValue else s <- s + String.replicate (int n) "3" (BigInteger.Parse s) % (bigint 1000000007) |> printfn "%A"