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.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException; 
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;

import static java.lang.System.out;
public class c693a
{ 
    //By shwetank_verma
    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        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; 
        } 
    } 
    static int mod=1000000007;
    static boolean primes[]=new boolean[1000007];
    static ArrayList<Integer> b=new ArrayList<>();
    static void seive(int n){
        Arrays.fill(primes,true);
        primes[0]=primes[1]=false;
        for(int i=2;i*i<=n;i++){
            if(primes[i]==true){
                for(int p=i*i;p<=n;p+=i){
                    primes[p]=false;
                }
            }
        }
        if(n<1000007){
        	for(int i=2;i<=n;i++) {
        		if(primes[i])
        			b.add(i);
        	}
           // return primes[n];
        }
     //   return false;
        
    }
    static int gcd(int a,int b){
        if(b==0)
        return a;
        return gcd(b,a%b);
    }
    static long GCD(long a,long b){
        if(b==0)
        return a;
        return GCD(b,a%b);
    }
    static ArrayList<Integer> segseive(int l,int r){
    	
    	ArrayList<Integer> isprime=new ArrayList<Integer>();
    	boolean p[]=new boolean[r-l+1];
    	Arrays.fill(p, true);
        
    	for(int i=0;b.get(i)*b.get(i)<=r;i++) {
    		int currprime=b.get(i);
    		int base=(l/currprime)*currprime;
    		if(base<l) {
    			base+=currprime;
    		}
    		for(int j=base;j<=r;j+=currprime) {
    			p[j-l]=false;
    		}
    		
    		
    		if(base==currprime) {
    			p[base-l]=true;
    		}
    		
    	}
    	for(int i=0;i<=r-l;i++) {
    		if(p[i])
    			isprime.add(i+l);
    	}
    	return isprime;
    }
      static int LowerBound(int a[], int x) { // x is the target value or key
  int l=-1,r=a.length;
  while(l+1<r) {
    int m=l+(r-l)/2;
    if(a[m]>=x) r=m;
    else l=m;
  }
  return r;
}
static int UpperBound(int a[], int x) {// x is the key or target value
    int l=-1,r=a.length;
    while(l+1<r) {
       int m=(l+r)>>>1;
       if(a[m]<=x) l=m;
       else r=m;
    }
    return l+1;
 }
static int ans=0;
  static void dfs(ArrayList<ArrayList<Integer>> adj,boolean visited[],int s,int c,int m,int val[]) {
	  visited[s]=true;
	  if(c<=m) {
		  if(val[s]==1)
			  c++;
		  else
			  c=0;
	  }
	  if(c>m)
		  return;
	  if(adj.get(s).size()==1&&s>1)
		  ans++;
	  for(int i:adj.get(s)) {
		  if(!visited[i]) {
			  
			  dfs(adj,visited,i,c,m,val);
			  
		  }
	  }
  }
  static void addEdge(ArrayList<ArrayList<Integer>> adj,int u,int v) {
	  adj.get(u).add(v);
	  adj.get(v).add(u);
  }
  static void bfs(ArrayList<ArrayList<Integer>> adj,int dist[],boolean visited[],int s) {
	  Queue<Integer> q=new ArrayDeque();
	  q.add(s);
	  visited[s]=true;
	  dist[s]=0;
	  while(!q.isEmpty()) {
		  s=q.poll();
		  for(int i:adj.get(s)) {
			  if(!visited[i]) {
				  visited[i]=true;
				  dist[i]=dist[s]+1;
				  q.add(i);
			  }
		  }
	  }
  }
 
    public static void main(String[] args) 
    { 
        FastReader sc=new FastReader(); 
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        
                int t=1;
               // t=sc.nextInt();
                
                while(t-->0){
            int n=sc.nextInt();
            long l=sc.nextLong();
            long r=sc.nextLong();
            long a=r/3-(l-1)/3;
            long b=(r+2)/3-(l+1)/3;
            long c=(r+1)/3-l/3;
            long dp[][]=new long[n+1][3];
            dp[1][0]=a;
            dp[1][1]=b;
            dp[1][2]=c;
            for(int i=2;i<=n;i++) {
            	dp[i][0]=dp[i-1][2]*b+dp[i-1][1]*c+dp[i-1][0]*a;
            	dp[i][1]=dp[i-1][2]*c+dp[i-1][1]*a+dp[i-1][0]*b;
            	dp[i][2]=dp[i-1][2]*a+dp[i-1][1]*b+dp[i-1][0]*c;
            	dp[i][0]%=mod;
            	dp[i][1]%=mod;
            	dp[i][2]%=mod;
            }
            out.print(dp[n][0]);
                }
           
        
        out.flush();
    } 
}

