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>
using namespace std;
bool Finish_read;
template <class T>
inline void read(T &x) {
  Finish_read = 0;
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    if (ch == EOF) return;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
  Finish_read = 1;
}
template <class T>
inline void print(T x) {
  if (x / 10 != 0) print(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
inline void writeln(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
  putchar('\n');
}
template <class T>
inline void write(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
namespace model {
const int mod = 2;
long long ksm(long long a, long long b) {
  int ans = 1;
  a %= mod;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return ans;
}
const int maxn = 1e5 + 7;
long long fac[maxn + 10], inv_fac[maxn + 10];
void init() {
  fac[0] = 1;
  for (int i = 1; i <= maxn; i++) fac[i] = (fac[i - 1] * i) % mod;
  inv_fac[maxn] = ksm(fac[maxn], mod - 2);
  for (int i = maxn - 1; i >= 0; i--)
    inv_fac[i] = (inv_fac[i + 1] * (i + 1)) % mod;
}
long long C(int n, int m) {
  if (n < 0 || m < 0 || m > n) return 0;
  if (m == 0 || m == n) return 1;
  return fac[n] * inv_fac[n - m] % mod * inv_fac[m] % mod;
}
}  // namespace model
const long long mod = 1e9 + 7;
int n, l, r;
const int maxn = 2e5 + 7;
int num[4];
long long dp[maxn][4];
long long dfs(int pos, long long val) {
  if (pos == n) return val == 0;
  if (dp[pos][val] != -1) return dp[pos][val];
  long long ret = 0;
  for (int i = 0; i < 3; i++)
    ret = (ret + dfs(pos + 1, (val + i) % 3) * num[i]) % mod;
  return dp[pos][val] = ret;
}
int main() {
  cin >> n >> l >> r;
  num[0] = r / 3 - (l - 1) / 3, num[1] = (r + 2) / 3 - (l + 1) / 3,
  num[2] = (r + 1) / 3 - l / 3;
  memset(dp, -1, sizeof(dp));
  cout << dfs(0, 0) << endl;
  return 0;
}
