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;
long long mod = 1000000007;
const long long inf = 92233720368547758;
bool isprime(long long n) {
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
long long fpow(long long a, long long b) {
  return b ? fpow(a * a % mod, b / 2) * (b % 2 ? a : 1) % mod : 1;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long inv(long long i) {
  if (i == 1) return 1;
  return (mod - ((mod / i) * inv(mod % i)) % mod) % mod;
}
long long dtb(long long x) {
  long long ans = 0;
  long long y = 1;
  while (x > 0) {
    ans += (x % 2) * y;
    x = x / 2;
    y = y * 10;
  }
  return ans;
}
vector<long long> adj[100009], vis(100009, 0);
void dfs(long long i) {
  vis[i] = 1;
  for (auto x : adj[i])
    if (!vis[x]) dfs(x);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  long long n, m, k;
  string s, s1, s2;
  string srr[100009];
  long long a, b, c, x = 0, y = 0, z = 0, l, r, t, p, d;
  long long ans = 0, cnt = 0, sum = 0, pos = 0;
  long long mx = 0, mn = 1000000000;
  long long arr[200009];
  vector<long long> va(500009, 0), vb(500009, 0), vc(500009, 0);
  map<long long, long long> make_pair;
  vector<long long> v, v1, v2;
  while (T--) {
    cin >> n >> l >> r;
    long long dp[200009][3] = {0};
    t = r - l + 1;
    x = t / 3;
    y = t / 3;
    z = t / 3;
    if (t % 3 == 1) {
      if (l % 3 == 0)
        z++;
      else if (l % 3 == 1)
        x++;
      else
        y++;
    } else if (t % 3 == 2) {
      if (l % 3 == 0) {
        z++;
        x++;
      } else if (l % 3 == 1) {
        x++;
        y++;
      } else {
        y++;
        z++;
      }
    }
    dp[0][0] = 1;
    for (int i = 1; i <= n; i++) {
      dp[i][1] = (dp[i - 1][1] * z + dp[i - 1][2] * y + dp[i - 1][0] * x) % mod;
      dp[i][2] = (dp[i - 1][1] * x + dp[i - 1][2] * z + dp[i - 1][0] * y) % mod;
      dp[i][0] = (dp[i - 1][1] * y + dp[i - 1][2] * x + dp[i - 1][0] * z) % mod;
    }
    cout << dp[n][0];
  }
  return 0;
}
