Ayoub had an array a of integers of size n and this array had two interesting properties: 

  * All the integers in the array were between l and r (inclusive). 
  * The sum of all the elements was divisible by 3. 



Unfortunately, Ayoub has lost his array, but he remembers the size of the array n and the numbers l and r, so he asked you to find the number of ways to restore the array. 

Since the answer could be very large, print it modulo 10^9 + 7 (i.e. the remainder when dividing by 10^9 + 7). In case there are no satisfying arrays (Ayoub has a wrong memory), print 0.

Input

The first and only line contains three integers n, l and r (1 ≤ n ≤ 2 ⋅ 10^5 , 1 ≤ l ≤ r ≤ 10^9) — the size of the lost array and the range of numbers in the array.

Output

Print the remainder when dividing by 10^9 + 7 the number of ways to restore the array.

Examples

Input


2 1 3


Output


3


Input


3 2 2


Output


1


Input


9 9 99


Output


711426616

Note

In the first example, the possible arrays are : [1,2], [2,1], [3, 3].

In the second example, the only possible array is [2, 2, 2].
#include <bits/stdc++.h>
const long long MAX = 300005;
const long long mod = 1e9 + 7;
using namespace std;
struct Link_Cut_Tree {
  long long n, m, top;
  long long fa[(10005)], w[(10005)], a[(10005)], st[(10005)];
  ;
  long long son[(10005)][2];
  bool fl[(10005)];
  bool is_root(long long x) { return son[fa[x]][0] != x && son[fa[x]][1] != x; }
  bool GET_ID(long long x) { return son[fa[x]][1] == x; }
  void pus(long long x) { w[x] = w[son[x][0]] ^ w[son[x][1]] ^ a[x]; }
  void down(long long x) {
    if (fl[x] && x) {
      if (son[x][0]) fl[son[x][0]] ^= 1;
      if (son[x][1]) fl[son[x][1]] ^= 1;
      swap(son[x][0], son[x][1]), fl[x] = 0;
    }
  }
  void rot(long long x) {
    long long y = fa[x], z = fa[y], k = GET_ID(x);
    if (!is_root(y)) son[z][GET_ID(y)] = x;
    son[y][k] = son[x][k ^ 1], son[x][k ^ 1] = y, fa[son[y][k]] = y, fa[y] = x,
    fa[x] = z;
    pus(y), pus(x);
  }
  void splay(long long x) {
    long long qwq = x;
    for (; !is_root(qwq); qwq = fa[qwq]) st[++top] = qwq;
    down(qwq);
    while (top) down(st[top--]);
    for (long long y; !is_root(x); rot(x))
      if (!is_root(y = fa[x])) rot(GET_ID(x) == GET_ID(y) ? y : x);
  }
  void access(long long x) {
    for (long long y = 0; x; y = x, x = fa[x]) splay(x), son[x][1] = y, pus(x);
  }
  void make_root(long long x) { access(x), splay(x), fl[x] ^= 1; }
  void split(long long x, long long y) { make_root(x), access(y), splay(y); }
  long long GET_ROOT(long long x) {
    access(x), splay(x);
    while (son[x][0]) x = son[x][0];
    return splay(x), x;
  }
  void cut(long long x, long long y) {
    split(x, y);
    if (son[y][0] == x) son[y][0] = fa[x] = 0;
  }
  void link(long long x, long long y) { make_root(x), fa[x] = y; }
  long long ask(long long x, long long y) { return split(x, y), w[y]; }
  void change(long long x, long long dis) {
    access(x), splay(x);
    w[x] = a[x] = dis, pus(x);
  }
} Tree;
long long n, l, r;
long long dp[MAX][3], Num[5];
long long Solve(long long x, long long qwq) {
  if (!x) return 0;
  long long ret = x / 3;
  if (qwq == 0)
    return ret;
  else
    return ret + (x % 3 >= qwq);
}
int main() {
  cin >> n >> l >> r;
  for (long long i = 0; i <= 2; i++)
    dp[1][i] = Num[i] = Solve(r, i) - Solve(l - 1, i);
  for (long long i = 1; i < n; ++i)
    for (long long j = 0; j <= 2; ++j) {
      if (dp[i][j])
        for (long long k = 0; k <= 2; k++)
          dp[i + 1][(j + k) % 3] =
              (dp[i + 1][(j + k) % 3] + 1LL * dp[i][j] * Num[k]) % mod;
    }
  cout << dp[n][0];
  return 0;
}
