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>
#pragma GCC optimize "O2"
using namespace std;
const long long int MOD = 1000000007;
const long double PI = 2 * acos(0.0);
vector<long long int> ga(long long int n) {
  vector<long long int> a;
  for (long long int i = 0; i < n; i++) {
    long long int p;
    cin >> p;
    a.push_back(p);
  }
  return move(a);
}
vector<long long int> gau(long long int n) {
  vector<long long int> a;
  for (long long int i = 0; i < n; i++) {
    long long int p;
    cin >> p;
    a.push_back(p);
  }
  return move(a);
}
vector<string> gas(long long int n) {
  vector<string> a;
  for (long long int i = 0; i < n; i++) {
    string p;
    cin >> p;
    a.push_back(p);
  }
  return move(a);
}
template <typename T, typename A>
void pa(vector<T, A> const &a) {
  for (T p : a) {
    cout << p << " ";
  }
  cout << "\n";
}
void yes() { cout << "YES\n"; }
void no() { cout << "NO\n"; }
void yesno(int f) {
  if (f)
    yes();
  else
    no();
}
long long int computefact(long long int start, long long int end) {
  long long int p = 1;
  for (long long int i = start; i <= end; i++) {
    p *= i;
    p %= MOD;
  }
  return p;
}
void solve() {
  long long int n, l, r;
  cin >> n >> l >> r;
  if (r - l + 1 == 1) {
    cout << (l % 3 == 0 || n % 3 == 0);
    return;
  }
  long long int rem0Div3Count =
      max(((r / 3) * 3 - ceil(l / 3.0) * 3) / 3 + 1, 0.0);
  long long int rem1Div3Count =
      max(((r % 3 == 1 ? r : (r % 3 == 2 ? (r - 1) : (r - 2))) -
           (l % 3 == 1 ? l : (l % 3 == 2 ? (l + 2) : (l + 1)))) /
                  3 +
              1,
          0ll);
  long long int rem2Div3Count = r - l + 1 - rem0Div3Count - rem1Div3Count;
  if (n == 1) {
    cout << rem0Div3Count << endl;
    return;
  }
  vector<vector<long long int>> dp(n + 1, vector<long long int>(3, 0));
  dp[1][0] = rem0Div3Count;
  dp[1][1] = rem1Div3Count;
  dp[1][2] = rem2Div3Count;
  for (long long int i = 2; i <= n; i++) {
    dp[i][0] = (dp[i - 1][1] * rem2Div3Count) % MOD +
               (dp[i - 1][0] * rem0Div3Count) % MOD +
               (dp[i - 1][2] * rem1Div3Count) % MOD;
    dp[i][1] = (dp[i - 1][1] * rem0Div3Count) % MOD +
               (dp[i - 1][0] * rem1Div3Count) % MOD +
               (dp[i - 1][2] * rem2Div3Count) % MOD;
    dp[i][2] = (dp[i - 1][1] * rem1Div3Count) % MOD +
               (dp[i - 1][0] * rem2Div3Count) % MOD +
               (dp[i - 1][2] * rem0Div3Count) % MOD;
    dp[i][0] %= MOD;
    dp[i][1] %= MOD;
    dp[i][2] %= MOD;
  }
  cout << (dp[n][0]);
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
