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 comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long mod = 1000000007;
long long a, b, c;
long long dp[200005][3];
long long call(long long pos, long long prev_mod) {
  if (pos == 0)
    if (prev_mod == 0)
      return 1;
    else
      return 0;
  if (dp[pos][prev_mod] != -1) return dp[pos][prev_mod];
  long long ret = 0;
  ret = (ret + (call(pos - 1, (prev_mod + 1) % 3) * a) % mod) % mod;
  ret = (ret + (call(pos - 1, (prev_mod + 2) % 3) * b) % mod) % mod;
  ret = (ret + (call(pos - 1, (prev_mod + 3) % 3) * c) % mod) % mod;
  return dp[pos][prev_mod] = ret;
}
int main() {
  memset(dp, -1, sizeof dp);
  long long n, l, r;
  cin >> n >> l >> r;
  if (r - l <= 10)
    for (long long i = l; i <= r; i++) {
      a += (bool)(i % 3 == 1);
      b += (bool)(i % 3 == 2);
      c += (bool)(i % 3 == 0);
    }
  else {
    while (l % 3 != 1) {
      a += (bool)(l % 3 == 1);
      b += (bool)(l % 3 == 2);
      c += (bool)(l % 3 == 0);
      l++;
    }
    while (r % 3 != 0) {
      a += (bool)(r % 3 == 1);
      b += (bool)(r % 3 == 2);
      c += (bool)(r % 3 == 0);
      r--;
    }
    int m = (r - l + 1) / 3;
    a += m;
    b += m;
    c += m;
  }
  cout << call(n, 0) % mod << endl;
}
