import sequtils,math proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord #[ const MOD = 1000000007 template useMatrix = type Matrix = ref object w,h:int data: seq[int] proc `[]`(m:Matrix,x,y:int):int = m.data[x + y * m.w] proc `[]=`(m:var Matrix,x,y,val:int) = m.data[x + y * m.w] = val proc newMatrix(w,h:int):Matrix = new(result) result.w = w result.h = h result.data = newSeq[int](w * h) proc identityMatrix(n:int):Matrix = result = newMatrix(n,n) for i in 0..= MOD: result.v = a mod MOD else: result.v = a proc `+`*(a,b:ModInt) : ModInt = result.v = a.v + b.v if result.v >= MOD : result.v = result.v mod MOD proc `*`*(a,b:ModInt) : ModInt = result.v = a.v * b.v if result.v >= MOD : result.v = result.v mod MOD proc `^`*(a:ModInt,b:int) : ModInt = if b == 0 : return 1.toModInt() if b == 1 : return a let pow = a^(b div 2) if b mod 2 == 0 : return pow * pow return pow * pow * a proc `+`*(a:int,b:ModInt) : ModInt = a.toModInt() + b proc `+`*(a:ModInt,b:int) : ModInt = a + b.toModInt() proc `-`*(a:ModInt,b:int) : ModInt = a + (-b) proc `-`*(a,b:ModInt) : ModInt = a + (-b.v) proc `-`*(a:int,b:ModInt) : ModInt = a.toModInt() + (-b.v) proc `*`*(a:int,b:ModInt) : ModInt = a.toModInt() * b proc `*`*(a:ModInt,b:int) : ModInt = a * b.toModInt() proc `/`*(a,b:ModInt) : ModInt = a * b^(MOD-2) proc `$`*(a:ModInt) : string = $a.v # useModulo() proc calcFib(n:int) : tuple[x:ModInt,y:ModInt] = if n == 0 : return (0.toModInt(),1.toModInt()) let (fn,fn1) = calcFib(n div 2) let fnx1 = fn1 - fn let f2n = (fn1 + fnx1) * fn let f2nx1 = fn * fn + fnx1 * fnx1 let f2n1 = f2n + f2nx1 if n mod 2 == 0 : return (f2n,f2n1) else: return (f2n1,f2n1 + f2n) let n = scan() echo calcFib(n)[0] * calcFib(n+1)[0]