#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <valarray>
#include <vector>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(__typeof((X).begin()) it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)(x).size())

using namespace std;

struct timer{
	time_t start;
	timer(){start=clock();}
	~timer(){cerr<<1.*(clock()-start)/CLOCKS_PER_SEC<<" secs"<<endl;}
};

typedef istringstream iss;
typedef long long ll;
typedef pair<int,int> pi;
typedef stringstream sst;
typedef vector<int> vi;

#define MN 210

int N_;
ll A[MN][MN];
ll B[MN][MN];
ll work[MN][MN];

const ll LIM=LLONG_MAX-(MOD-1)*(MOD-1);

// a := a*b
void matmul(ll a[][MN], ll b[][MN]){
	memset(work,0,sizeof(work));
	rep(i,N_)rep(k,N_)rep(j,N_){
		work[i][j]+=a[i][k]*b[k][j];
		if(work[i][j]>LIM)work[i][j]%=MOD;
	}
	rep(i,N_)rep(j,N_)a[i][j]=work[i][j]%MOD;
}

// a := b*a
void matmulleft(ll a[][MN], ll b[][MN]){
	memset(work,0,sizeof(work));
	rep(i,N_)rep(k,N_)rep(j,N_){
		work[i][j]+=b[i][k]*a[k][j];
		if(work[i][j]>LIM)work[i][j]%=MOD;
	}
	rep(i,N_)rep(j,N_)a[i][j]=work[i][j]%MOD;
}

// a := a^2
void matsq(ll a[][MN]){
	memset(work,0,sizeof(work));
	rep(i,N_)rep(k,N_)rep(j,N_){
		work[i][j]+=a[i][k]*a[k][j];
		if(work[i][j]>LIM)work[i][j]%=MOD;
	}
	rep(i,N_)rep(j,N_)a[i][j]=work[i][j]%MOD;
}

// A := A^n
void matpow(ll a[][MN],ll n){
	memset(B,0,sizeof(B));
	rep(i,N_)B[i][i]=1;
	while(n){
		if(n&1)matmul(B,A);
		matsq(A);
		n>>=1;
	}
	rep(i,N_)rep(j,N_)A[i][j]=B[i][j];
}

ll fib(ll n){
	n+=1;
	N_=2;
	A[0][0]=1;A[0][1]=1;
	A[1][0]=1;A[1][1]=0;
	matpow(A,n);
	return A[1][0];
}

ll N;

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	cin>>N;
	ll lo=0,hi=INF*2;
	while(lo+1<hi){
		ll mi=lo+hi>>1;
		ll m=(mi+1)/2;
		ll sum=m*(m+1)/2*2;
		if(mi%2){
			sum-=m;
		}
		//cout<<mi<<" "<<sum<<endl;
		if(sum>=N)hi=mi;
		else lo=mi;
	}
	ll M=hi;
	ll m=(M+1)/2;
	ll sum=m*(m+1)/2*2;
	if(M%2){
		sum-=m;
	}
	ll no=m-(sum-N);
	//cout<<M<<" "<<no<<endl;
	ll a;
	if(no <= (m+1)/2) a = no*2-1;
	else{
		if(m%2) a = m-1 - (no-(m+1)/2-1)*2;
		else a = m - (no-m/2-1)*2;
	}
	ll b = M+1-a;
	//cout<<a<<" "<<b<<endl;
	cout<<fib(a)*fib(b)%MOD<<endl;
}
### Prompt

Develop a solution in CPP to the problem described below:

Example

Input

5


Output

5

### Response

```cpp
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <valarray>
#include <vector>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(__typeof((X).begin()) it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)(x).size())

using namespace std;

struct timer{
	time_t start;
	timer(){start=clock();}
	~timer(){cerr<<1.*(clock()-start)/CLOCKS_PER_SEC<<" secs"<<endl;}
};

typedef istringstream iss;
typedef long long ll;
typedef pair<int,int> pi;
typedef stringstream sst;
typedef vector<int> vi;

#define MN 210

int N_;
ll A[MN][MN];
ll B[MN][MN];
ll work[MN][MN];

const ll LIM=LLONG_MAX-(MOD-1)*(MOD-1);

// a := a*b
void matmul(ll a[][MN], ll b[][MN]){
	memset(work,0,sizeof(work));
	rep(i,N_)rep(k,N_)rep(j,N_){
		work[i][j]+=a[i][k]*b[k][j];
		if(work[i][j]>LIM)work[i][j]%=MOD;
	}
	rep(i,N_)rep(j,N_)a[i][j]=work[i][j]%MOD;
}

// a := b*a
void matmulleft(ll a[][MN], ll b[][MN]){
	memset(work,0,sizeof(work));
	rep(i,N_)rep(k,N_)rep(j,N_){
		work[i][j]+=b[i][k]*a[k][j];
		if(work[i][j]>LIM)work[i][j]%=MOD;
	}
	rep(i,N_)rep(j,N_)a[i][j]=work[i][j]%MOD;
}

// a := a^2
void matsq(ll a[][MN]){
	memset(work,0,sizeof(work));
	rep(i,N_)rep(k,N_)rep(j,N_){
		work[i][j]+=a[i][k]*a[k][j];
		if(work[i][j]>LIM)work[i][j]%=MOD;
	}
	rep(i,N_)rep(j,N_)a[i][j]=work[i][j]%MOD;
}

// A := A^n
void matpow(ll a[][MN],ll n){
	memset(B,0,sizeof(B));
	rep(i,N_)B[i][i]=1;
	while(n){
		if(n&1)matmul(B,A);
		matsq(A);
		n>>=1;
	}
	rep(i,N_)rep(j,N_)A[i][j]=B[i][j];
}

ll fib(ll n){
	n+=1;
	N_=2;
	A[0][0]=1;A[0][1]=1;
	A[1][0]=1;A[1][1]=0;
	matpow(A,n);
	return A[1][0];
}

ll N;

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	cin>>N;
	ll lo=0,hi=INF*2;
	while(lo+1<hi){
		ll mi=lo+hi>>1;
		ll m=(mi+1)/2;
		ll sum=m*(m+1)/2*2;
		if(mi%2){
			sum-=m;
		}
		//cout<<mi<<" "<<sum<<endl;
		if(sum>=N)hi=mi;
		else lo=mi;
	}
	ll M=hi;
	ll m=(M+1)/2;
	ll sum=m*(m+1)/2*2;
	if(M%2){
		sum-=m;
	}
	ll no=m-(sum-N);
	//cout<<M<<" "<<no<<endl;
	ll a;
	if(no <= (m+1)/2) a = no*2-1;
	else{
		if(m%2) a = m-1 - (no-(m+1)/2-1)*2;
		else a = m - (no-m/2-1)*2;
	}
	ll b = M+1-a;
	//cout<<a<<" "<<b<<endl;
	cout<<fib(a)*fib(b)%MOD<<endl;
}
```