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].
//codeforces_codeforces_1105C

import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static java.lang.Math.*;
import java.math.*;

public class Main {

    static PrintWriter go = new PrintWriter(System.out);
    static final long mod = 1000000007;
    static long[][][] memo;
    static long[] values;
    static long n, l, r;

    public static void main(String args[]) throws IOException, FileNotFoundException {

        BufferedReader gi = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter go = new PrintWriter(System.out);
        int[] L = parseArray(gi);
        n = (long) L[0];
        l = (long) L[1];
        r = (long) L[2];
        values = new long[3];
        memo = new long[(int)n][3][3];
        values[0] = r / 3 - (l - 1) / 3;
        values[1] = r / 3 + (r % 3 > 0 ? 1 : 0) - ((l - 1) / 3 + ((l - 1) % 3 > 0 ? 1 : 0));
        values[2] = r / 3 + (r % 3 > 1 ? 1 : 0) - ((l - 1) / 3 + ((l - 1) % 3 > 1 ? 1 : 0));
        for (int k = 0; k < n; k++) {
            for (int i = 0; i < 3; i++) {memo[k][i][0] = memo[k][i][1] = memo[k][i][2] = -1;}
        }
        go.println(((values[0]*dp(1, 0, 0)%mod + values[1]*dp(1, 1, 1)%mod)%mod + values[2]*dp(1, 2, 2)%mod)%mod);
        go.close();
    }

    static long dp(int idx, int rem, int v) {
        if (idx == n) {return v==0?1:0;}
        if (memo[idx][rem][v] != -1) {return memo[idx][rem][v];}
        long ans = (values[rem] * dp(idx + 1, rem % 3, (rem + v) % 3)) % mod;
        ans %= mod;
        ans += (values[(rem + 1) % 3] * dp(idx + 1, (rem + 1) % 3, (v + (rem + 1) % 3) % 3)) % mod;
        ans %= mod;
        ans += (values[(rem + 2) % 3] * dp(idx + 1, (rem + 2) % 3, (v + (rem + 2) % 3) % 3)) % mod;
        ans %= mod;
        return memo[idx][rem][v] = ans;
    }

    static int[] parseArray(BufferedReader gi) throws IOException {
        String[] line = gi.readLine().trim().split(" ");
        int[] rez = new int[line.length];
        for (int k = 0; k < line.length; k++) {
            rez[k] = Integer.parseInt(line[k]);
        }
        return rez;
    }

}