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.*;
import java.lang.*;
import java.io.*;

public class Main
{
	PrintWriter out = new PrintWriter(System.out);
	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer tok = new StringTokenizer("");
    String next() throws IOException {
        if (!tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine()); }
        return tok.nextToken();
    }
    int ni() throws IOException { return Integer.parseInt(next()); }
    long nl() throws IOException { return Long.parseLong(next()); }
    
    long mod=1000000007;
    
    void solve() throws IOException {
        int n=ni(),lt=ni(),rt=ni();
        long[][]a=new long[n][3];
        
        int tar=(rt/3)*3;
        long[]b=new long[3];
        if (lt%3==1) { b[1]++; lt++; }
        if (lt<=rt && lt%3==2) { b[2]++; lt++; }
        if (lt<=rt) {
            b[0]++;
            int i=(tar-lt)/3;
            b[0]+=i;
            b[1]+=i;
            b[2]+=i;
            tar++;
            if (tar<=rt) { b[1]++; tar++; }
            if (tar<=rt) { b[2]++; tar++; }
        }
        
        a[n-1][0]=b[0];
        a[n-1][1]=b[1];
        a[n-1][2]=b[2];
        
        for (int i=n-2;i>=0;i--) {
            a[i][0]=(a[i+1][0]*b[0]+a[i+1][1]*b[2]+a[i+1][2]*b[1])%mod;
            a[i][1]=(a[i+1][0]*b[1]+a[i+1][1]*b[0]+a[i+1][2]*b[2])%mod;
            a[i][2]=(a[i+1][0]*b[2]+a[i+1][1]*b[1]+a[i+1][2]*b[0])%mod;
        }
        
        System.out.println(a[0][0]);
    }
    
    int gcd(int a,int b) { return(b==0?a:gcd(b,a%b)); }
    long gcd(long a,long b) { return(b==0?a:gcd(b,a%b)); }
    long mp(long a,long p) { long r=1; while(p>0) { if ((p&1)==1) r=(r*a)%mod; p>>=1; a=(a*a)%mod; } return r; }
    
    public static void main(String[] args) throws IOException {
        new Main().solve();
    }
}