Problem: The Prodiggers are quite a cool band and for this reason, they have been the surprise guest at the ENTER festival for the past 80 years. At the beginning of their careers, they weren’t so successful, so they had to spend time digging channels to earn money; hence the name. Anyway, they like to tour a lot and have surprising amounts of energy to do extremely long tours. However, they hate spending two consecutive days without having a concert, so they would like to avoid it.

A tour is defined by a sequence of concerts and days-off. You need to count in how many ways The Prodiggers can select k different tours of the same length between l and r.

For example if k = 2, l = 1 and r = 2, if we define concert day as {1} and day-off as {0}, here are all possible tours: {0}, {1}, {00}, {01}, {10}, {11}. But tour 00 can not be selected because it has 2 days-off in a row. Now, we need to count in how many ways we can select k = 2 tours of the same length in range [1;2]. Here they are: {0,1}; {01,10}; {01,11}; {10,11}.

Since their schedule is quite busy, they want you to tell them in how many ways can do that, modulo 1 000 000 007 (109 + 7).

Input

The first line of the input contains three integers k, l and r (1 ≤ k ≤ 200, 1 ≤ l ≤ r ≤ 1018).

Output

Output a single number: the number of ways to select k different tours of the same length, modulo 1 000 000 007.

Example

Input

1 1 2


Output

5

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int rmax = 60;
bool bit(long long mask, int pos) { return (mask >> pos) & 1; }
void mul(long long& a, long long b) {
  a *= b;
  if (a >= mod) {
    a %= mod;
  }
}
void add(long long& a, long long b) {
  a += b;
  if (a >= mod) {
    a -= mod;
  }
}
void sub(long long& a, long long b) {
  a -= b;
  if (a < 0) {
    a += mod;
  }
}
long long binpow(long long a, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) {
      mul(ans, a);
    }
    n >>= 1;
    mul(a, a);
  }
  return ans;
}
struct data {
  long long a, b;
  data() : a(0), b(0) {}
  data(long long a, long long b) : a(a), b(b) {}
  data operator+(const data& other) const {
    long long new_a = a;
    add(new_a, other.a);
    long long new_b = b;
    add(new_b, other.b);
    return {new_a, new_b};
  }
  data operator*(const data& other) const {
    long long val1 = a;
    mul(val1, other.b);
    long long val2 = b;
    mul(val2, other.a);
    add(val1, val2);
    long long new_b = val1;
    val1 = a;
    mul(val1, other.a);
    val2 = b;
    mul(val2, other.b);
    mul(val2, 5);
    add(val1, val2);
    return {val1, new_b};
  }
  data operator-(const data& other) const {
    long long new_a = a;
    sub(new_a, other.a);
    long long new_b = b;
    sub(new_b, other.b);
    return {new_a, new_b};
  }
};
vector<vector<data> > dp;
vector<vector<long long> > bin;
long long r5 = binpow(5, mod - 2);
data count_magic(long long n, int k) {
  if (n == 0) {
    return {0, 0};
  }
  data res;
  for (int j = 0; j <= k; ++j) {
    data val = dp[k][j];
    vector<data> sum(rmax);
    vector<data> degs(rmax);
    degs[0] = val;
    sum[0] = {1, 0};
    for (int i = 1; i < rmax; ++i) {
      sum[i] = sum[i - 1] + degs[i - 1] * sum[i - 1];
      degs[i] = degs[i - 1] * degs[i - 1];
    }
    data ans;
    data curr = {1, 0};
    for (int r = rmax - 1; r >= 0; --r) {
      if (bit(n + 1, r)) {
        ans = ans + sum[r] * curr;
        curr = curr * degs[r];
      }
    }
    mul(ans.a, bin[k][j]);
    mul(ans.b, bin[k][j]);
    if ((k - j) & 1) {
      ans.a = mod - ans.a;
      ans.b = mod - ans.b;
    }
    long long r = binpow(r5, k / 2);
    mul(ans.a, r);
    mul(ans.b, r);
    if (k & 1) {
      long long new_a = ans.b;
      long long new_b = ans.a;
      mul(new_b, r5);
      ans = {new_a, new_b};
    }
    res = res + ans;
  }
  return res;
}
vector<long long> mul(const vector<long long>& a, const vector<long long>& b) {
  int n = (int)(a).size() - 1, m = (int)(b).size() - 1;
  vector<long long> c(n + m + 1);
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= m; ++j) {
      long long val = a[i];
      mul(val, b[j]);
      add(c[i + j], val);
    }
  }
  return c;
}
int main() {
  int k;
  long long l, r;
  cin >> k >> l >> r;
  l += 2, r += 2;
  dp = vector<vector<data> >(k + 1, vector<data>(k + 1));
  vector<data> degs_plus(k + 1), degs_minus(k + 1);
  degs_plus[0] = degs_minus[0] = {1, 0};
  long long r2 = binpow(2, mod - 2);
  for (int i = 1; i <= k; ++i) {
    data tmp = {r2, r2};
    degs_plus[i] = degs_plus[i - 1] * tmp;
    tmp = {r2, mod - r2};
    degs_minus[i] = degs_minus[i - 1] * tmp;
  }
  for (int i = 0; i <= k; ++i) {
    for (int j = 0; j <= i; ++j) {
      dp[i][j] = degs_plus[j] * degs_minus[i - j];
    }
  }
  bin = vector<vector<long long> >(k + 1, vector<long long>(k + 1));
  bin[0][0] = 1;
  for (int i = 1; i <= k; ++i) {
    bin[i][0] = 1;
    for (int j = 1; j <= k; ++j) {
      bin[i][j] = bin[i - 1][j];
      add(bin[i][j], bin[i - 1][j - 1]);
    }
  }
  if (l > r) {
    cout << "0\n";
    return 0;
  }
  vector<long long> p = {0, 1};
  for (int i = 2; i <= k; ++i) {
    long long t = binpow(i, mod - 2);
    vector<long long> q(2);
    q[1] = t;
    q[0] = mod - t;
    mul(q[0], i - 1);
    vector<long long> r = mul(p, q);
    p = r;
  }
  data ans;
  for (int i = 0; i <= k; ++i) {
    data val = count_magic(r, i);
    mul(val.a, p[i]);
    mul(val.b, p[i]);
    ans = ans + val;
    val = count_magic(l - 1, i);
    mul(val.a, p[i]);
    mul(val.b, p[i]);
    ans = ans - val;
  }
  cout << ans.a << "\n";
}