#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

const ll M=1e9+7;
typedef vector<ll> vec;
typedef vector<vec> mat;
struct Matrix{
  ll N;
  mat a;
  Matrix(ll n){
    N=n;
    a=mat(N,vec(N));
    for(int i=0;i<N;i++)a[i][i]=1;
  }
  Matrix pow(ll b) const {
    Matrix res(N);
    Matrix d(N);
    for(int i=0;i<N;i++)for(int j=0;j<N;j++)d[i][j]=a[i][j];
    for(;b>0;b>>=1,d=d*d)if(b&1)res=d*res;
    return res;
  }
  Matrix operator+(const Matrix& r) const {
    Matrix s(N);
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        s[i][j]=(a[i][j]+r.a[i][j])%M;
      }
    }
    return s;
  }
  Matrix operator*(const Matrix& r) const {
    Matrix s(N);
    for(int i=0;i<N;i++)s[i][i]=0;
    const long long modl=8*M*M;
    for(int i=0;i<N;i++){
      for(int k=0;k<N;k++){
        for(int j=0;j<N;j++){
          s[i][j]+=a[i][k]*r.a[k][j];
          if(s[i][j]>=modl)s[i][j]-=modl;
        }
      }
      for(int j=0;j<N;j++)s[i][j]%=M;
    }
    return s;
  }

  vector<ll>& operator[](ll i){
    return a[i];
  }
};

ll fib(ll n){
  Matrix A(2);
  A[0][0]=1; A[0][1]=1;
  A[1][0]=1; A[1][1]=0;
  Matrix res=A.pow(n+1);
  return res[1][0];
}

ll K;

int main(){
  cin>>K;
  ll lb=0,ub=1e9;
  while(ub-lb>1){
    ll mid=(lb+ub)/2;
    if(mid*(mid+1)<K)lb=mid;
    else ub=mid;
  }
  K-=lb*(lb+1);
  ll N=ub;
  ll si=1,sj=(N-1)*2+1;
  if(K>N){
    K-=N;
    sj++;
  }
  ll num1,num2;
  if(N%2==0){
    num1=N/2+1;
  }else{
    num1=(N+1)/2;
  }
  num2=N-num1;
  if(N%2==0){
    if(K<=num1){
      if(K==num1){
        si+=N-1; sj-=N-1;
      }else{
        si+=2*(K-1); sj-=2*(K-1);
      }
    }else{
      si+=N-1; sj-=N-1;
      K-=num1;
      si-=2*K; sj+=2*K;
    }
  }else{
    if(K<=num1){
      si+=2*(K-1); sj-=2*(K-1);
    }else{
      K-=num1;
      si+=N-1; sj-=N-1;
      si-=1; sj+=1;
      si-=2*(K-1); sj+=2*(K-1);
    }
  }
  cout<<fib(si)*fib(sj)%mod<<endl;
  return 0;
}


### Prompt

Your challenge is to write a CPP solution to the following problem:

Example

Input

5


Output

5

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

const ll M=1e9+7;
typedef vector<ll> vec;
typedef vector<vec> mat;
struct Matrix{
  ll N;
  mat a;
  Matrix(ll n){
    N=n;
    a=mat(N,vec(N));
    for(int i=0;i<N;i++)a[i][i]=1;
  }
  Matrix pow(ll b) const {
    Matrix res(N);
    Matrix d(N);
    for(int i=0;i<N;i++)for(int j=0;j<N;j++)d[i][j]=a[i][j];
    for(;b>0;b>>=1,d=d*d)if(b&1)res=d*res;
    return res;
  }
  Matrix operator+(const Matrix& r) const {
    Matrix s(N);
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        s[i][j]=(a[i][j]+r.a[i][j])%M;
      }
    }
    return s;
  }
  Matrix operator*(const Matrix& r) const {
    Matrix s(N);
    for(int i=0;i<N;i++)s[i][i]=0;
    const long long modl=8*M*M;
    for(int i=0;i<N;i++){
      for(int k=0;k<N;k++){
        for(int j=0;j<N;j++){
          s[i][j]+=a[i][k]*r.a[k][j];
          if(s[i][j]>=modl)s[i][j]-=modl;
        }
      }
      for(int j=0;j<N;j++)s[i][j]%=M;
    }
    return s;
  }

  vector<ll>& operator[](ll i){
    return a[i];
  }
};

ll fib(ll n){
  Matrix A(2);
  A[0][0]=1; A[0][1]=1;
  A[1][0]=1; A[1][1]=0;
  Matrix res=A.pow(n+1);
  return res[1][0];
}

ll K;

int main(){
  cin>>K;
  ll lb=0,ub=1e9;
  while(ub-lb>1){
    ll mid=(lb+ub)/2;
    if(mid*(mid+1)<K)lb=mid;
    else ub=mid;
  }
  K-=lb*(lb+1);
  ll N=ub;
  ll si=1,sj=(N-1)*2+1;
  if(K>N){
    K-=N;
    sj++;
  }
  ll num1,num2;
  if(N%2==0){
    num1=N/2+1;
  }else{
    num1=(N+1)/2;
  }
  num2=N-num1;
  if(N%2==0){
    if(K<=num1){
      if(K==num1){
        si+=N-1; sj-=N-1;
      }else{
        si+=2*(K-1); sj-=2*(K-1);
      }
    }else{
      si+=N-1; sj-=N-1;
      K-=num1;
      si-=2*K; sj+=2*K;
    }
  }else{
    if(K<=num1){
      si+=2*(K-1); sj-=2*(K-1);
    }else{
      K-=num1;
      si+=N-1; sj-=N-1;
      si-=1; sj+=1;
      si-=2*(K-1); sj+=2*(K-1);
    }
  }
  cout<<fib(si)*fib(sj)%mod<<endl;
  return 0;
}


```