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.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class CF1105C {



    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long l = sc.nextLong();
        long r = sc.nextLong();


        //余0的情况
        long mod0 = getMod0(r) - getMod0(l - 1);

        //余1的情况
        long mod1 = getMod1(r) - getMod1(l - 1);

        //余2的情况
        long mod2 = getMod2(r) - getMod2(l - 1);


        //dp[i][j] : 第i位以前，所有数的和余j的组合总数
        long[][] dp = new long[200001][3];
        dp[0][0] = mod0;
        dp[0][1] = mod1;
        dp[0][2] = mod2;
        for(int i = 1; i < n; i ++){
            //余0的情况 = 前面余0 * 当前余0 + 前面余1 * 当前余2 + 前面余2 * 当前余1
            dp[i][0] = (dp[i - 1][0] * mod0 + dp[i - 1][1] * mod2 + dp[i - 1][2] * mod1) % 1000000007;


            //余1的情况 = 前面余0 * 当前余1 + 前面余1 * 当前余0 + 前面余2 * 当前余2
            dp[i][1] = (dp[i - 1][0] * mod1 + dp[i - 1][1] * mod0 + dp[i - 1][2] * mod2) % 1000000007;


            //余2的情况 = 前面余0 * 当前余2 + 前面余1 * 当前余1 + 前面余2 * 当前余0
            dp[i][2] = (dp[i - 1][0] * mod2 + dp[i - 1][1] * mod1 + dp[i - 1][2] * mod0) % 1000000007;
        }

        System.out.println(dp[n-1][0]);

    }

    private static long getMod0(long x){
        return x / 3;
    }

    private static long getMod1(long x){
        long mod = x / 3;
        long d = x % 3;

        if(d > 0){
            mod = mod + 1;
        }
        return mod;
    }

    private static long getMod2(long x){
        long mod = x / 3;
        long d = x % 3;

        if(d == 2){
            mod = mod + 1;
        }
        return mod;
    }
}