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].
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;


/**
 * @authod Rashedul Hasan Rijul
 */
public class Solution {

    FastReader fastReader;
    OutputStream outputStream = System.out;
    PrintWriter out;
    int[] cnt = new int[4];

    long[][] dp;
    boolean[][] vis;

    static long MOD_VALUE = 1000000007;

    public Solution() {
    }

    public Solution(FastReader fastReader) {
        this.fastReader = fastReader;
        this.out = new PrintWriter(outputStream, true);
    }

    public void solve() {

        int n = fastReader.nextInt();
        int l = fastReader.nextInt();
        int r = fastReader.nextInt();

        cnt[0] = cnt[1] = cnt[2] = 0;

        cnt[0] = getNumberOf3(0, r) - getNumberOf3(0, l-1);
        cnt[1] = getNumberOf3(1, r) - getNumberOf3(1, l-1);
        cnt[2] = getNumberOf3(2, r) - getNumberOf3(2, l-1);

        dp = new long[n + 2][4];
        vis = new boolean[n + 2][4];

        for (int i = 0; i <= n; i += 10000) {
            for (int j = 0; j < 3; j++) {
                cal(i, j);
            }
        }

        long ans = cal(n, 0);

        System.out.println(ans);
    }

    private int getNumberOf3(int mod_value, int range) {

        if (range == 0) return 0;
        if (mod_value == 0) {
            return range / 3;
        }

        int value = range / 3;

        if (range % 3 >= mod_value) {
            value++;
        }
        return value;
    }

    private long cal(int rem, int modulo) {

        modulo %= 3;
        if (rem == 0 && modulo == 0) {
            return 1;
        }
        if (rem == 0) {
            return 0;
        }

        if (vis[rem][modulo]) return dp[rem][modulo];
        vis[rem][modulo] = true;

        long ret = 0;
        ret += (cnt[0] * cal(rem - 1, modulo + 0));
        if (ret >= MOD_VALUE) {
            ret %= MOD_VALUE;
        }

        ret += (cnt[1] * cal(rem - 1, modulo + 1));
        if (ret >= MOD_VALUE) {
            ret %= MOD_VALUE;
        }

        ret += (cnt[2] * cal(rem - 1, modulo + 2));
        if (ret >= MOD_VALUE) {
            ret %= MOD_VALUE;
        }

        return dp[rem][modulo] = ret;
    }


    private static double round(double value, int places) {
        if (places < 0) throw new IllegalArgumentException();

        BigDecimal bd = new BigDecimal(Double.toString(value));
        bd = bd.setScale(places, RoundingMode.HALF_UP);
        return bd.doubleValue();
    }

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

        // for testing in local
        // FastReader fastReader = FastReader.getFileReader("in.txt");

        FastReader fastReader = FastReader.getDefaultReader();

        Solution soln = new Solution(fastReader);
        soln.solve();


    }


    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        public static FastReader getFileReader(String fileName) throws FileNotFoundException {
            return new FastReader(new InputStreamReader(new FileInputStream(new File("in.txt"))));
        }

        public static FastReader getDefaultReader() throws FileNotFoundException {
            return new FastReader();
        }

        public FastReader(InputStreamReader inputStreamReader) {
            br = new BufferedReader(inputStreamReader);
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

