#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FOR(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define FOREQ(i, s, n) for (ll i = (s); i <= (ll)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

const ll MOD = 1e+9 + 7;
void Mul(ll lhs[4], ll rhs[4]) {
  ll temp[4];
  MEMSET(temp, 0);
  REP(y, 2) {
    REP(x, 2) {
      REP(k, 2) {
        temp[y * 2 + x] = (temp[y * 2 + x] + lhs[y * 2 + k] * rhs[k * 2 + x]) % MOD;
      }
    }
  }
  memcpy(lhs, temp, sizeof(temp));
}

ll Fib(ll x) {
  ll ret[4] = { 1, 0, 0, 1 };
  ll base[4] = { 1, 1, 1, 0 };
  while (x > 0) {
    if (x & 1) { Mul(ret, base); }
    Mul(base, base);
    x >>= 1;
  }
  return ret[0];
}

ll Sum(ll x) {
  ll ret = ((x + 1) / 2) * ((x + 1) / 2 + 1);
  if (x & 1) { ret -= (x + 1) / 2; }
  return ret;
}

ll n;
int main() {
  while (scanf("%lld", &n) > 0) {
    ll ans = 0;
    ll index = sqrt(n) * 2;
    index = max(0LL, index - 3);
    while (Sum(index) < n) { index++; }
    ll offset = n - Sum(index - 1) - 1;
    ll w = (index + 1) / 2;
    if (offset <  (w + 1) / 2) {
      ll x = index - offset * 2;
      ll y = 1 + offset * 2;
      ans = Fib(x) * Fib(y) % MOD;
    } else {
      offset -= (w + 1) / 2;
      ll x = index - w + 1;
      ll y = w;
      if (w % 2 == 1) { y--; x++; }
      x += 2 * offset;
      y -= 2 * offset;
      ans = Fib(x) * Fib(y) % MOD;
    }
    printf("%lld\n", ans);
  }
}
### Prompt

Your task is to create a cpp solution to the following problem:

Example

Input

5


Output

5

### Response

```cpp
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FOR(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define FOREQ(i, s, n) for (ll i = (s); i <= (ll)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

const ll MOD = 1e+9 + 7;
void Mul(ll lhs[4], ll rhs[4]) {
  ll temp[4];
  MEMSET(temp, 0);
  REP(y, 2) {
    REP(x, 2) {
      REP(k, 2) {
        temp[y * 2 + x] = (temp[y * 2 + x] + lhs[y * 2 + k] * rhs[k * 2 + x]) % MOD;
      }
    }
  }
  memcpy(lhs, temp, sizeof(temp));
}

ll Fib(ll x) {
  ll ret[4] = { 1, 0, 0, 1 };
  ll base[4] = { 1, 1, 1, 0 };
  while (x > 0) {
    if (x & 1) { Mul(ret, base); }
    Mul(base, base);
    x >>= 1;
  }
  return ret[0];
}

ll Sum(ll x) {
  ll ret = ((x + 1) / 2) * ((x + 1) / 2 + 1);
  if (x & 1) { ret -= (x + 1) / 2; }
  return ret;
}

ll n;
int main() {
  while (scanf("%lld", &n) > 0) {
    ll ans = 0;
    ll index = sqrt(n) * 2;
    index = max(0LL, index - 3);
    while (Sum(index) < n) { index++; }
    ll offset = n - Sum(index - 1) - 1;
    ll w = (index + 1) / 2;
    if (offset <  (w + 1) / 2) {
      ll x = index - offset * 2;
      ll y = 1 + offset * 2;
      ans = Fib(x) * Fib(y) % MOD;
    } else {
      offset -= (w + 1) / 2;
      ll x = index - w + 1;
      ll y = w;
      if (w % 2 == 1) { y--; x++; }
      x += 2 * offset;
      y -= 2 * offset;
      ans = Fib(x) * Fib(y) % MOD;
    }
    printf("%lld\n", ans);
  }
}
```