$n=<>; for$m(2e9+16,1e9+7){ ($a,$b)=(1,0); for($s=64;$s--;){ ($a,$b)=( ($a*$a+$b*$b)%$m, ($a*$b+($a-$b)%$m*$b)%$m ); ($a,$b)=( ($a+$b)%$m,$a )if$n>>$s&1 } $n=$b } print$n