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].
//package DP;
import java.util.*;
import java.io.*;
public class A{
	static final int mod = (int) 1e9 + 7;
	static final int inf = (int) 1e9;
	static final long INF = (long) 1e18;
	static long dp[][]=new long[(int)2e5+7][3];
	static int l,r,n;static int cnt_zero,cnt_one,cnt_two=0;
	public static void main(String[] args) throws IOException
	{
		FastScanner fs=new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		n=fs.nextInt();l=fs.nextInt();r=fs.nextInt();
		fill();
		cnt_zero=(r/3)-(l-1)/3;
		cnt_one=(r+2)/3-(l+1)/3;
		cnt_two=(r+1)/3-(l/3);
		out.println(solve(n,0));out.close();
	}
	public static void fill()
	{
		for(int i=0;i<dp.length;i++)
			Arrays.fill(dp[i],-1);
	}
	public static long solve(int ind,int get)
	{
		if(ind==1)
		{
			if(get==0)return dp[ind][get]=cnt_zero;
			else if(get==1)return dp[ind][get]=cnt_one;
			else return dp[ind][get]=cnt_two;
		}
		if(dp[ind][get]!=-1)return dp[ind][get];
		long ans=0;
		if(get==0)
		{
			ans=solve(ind-1,0)*cnt_zero+solve(ind-1,1)*cnt_two+solve(ind-1,2)*cnt_one;
		}
		else if(get==1)
		{
			ans=solve(ind-1,0)*cnt_one+solve(ind-1,1)*cnt_zero+solve(ind-1,2)*cnt_two;
		}
		else
		{
			ans=solve(ind-1,0)*cnt_two+solve(ind-1,1)*cnt_one+solve(ind-1,2)*cnt_zero;
		}
		return dp[ind][get]=ans%mod;
	}
	// returns the index of the smallest element in the array that is greater than
	// or equal to
	// the given element.
	public static int lower_bound(int arr[], int key) {
		int index = inf, num = 0;
		int left = 0, right = arr.length - 1;
		while (left <= right) {
			int mid = left + (right - left) / 2;
			if (arr[mid] >= key) {
				index = mid;
				num = arr[mid];
				right = mid - 1;
			} else
				left = mid + 1;
		}
		return index == inf ? arr.length : index;
	}

	// returns the index of the smallest element in the array that is less than or
	// equal to
	// the given element.
	public static int upper_bound(int arr[], int key) {
		int index = inf, num = 0;
		int left = 0, right = arr.length - 1;
		while (left <= right) {
			int mid = left + (right - left) / 2;
			if (arr[mid] <= key) {
				index = mid;
				num = arr[mid];
				left = mid + 1;
			} else
				right = mid - 1;
		}
		return index == inf ? arr.length : index;
	}
}

class FastScanner {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = new StringTokenizer("");

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

	}

	public String nextLine() throws IOException {
		return br.readLine();
	}

	int[] sort(int arr[]) {
		ArrayList<Integer> list = new ArrayList<Integer>();
		for (int i : arr)
			list.add(i);
		Collections.sort(list);
		for (int i = 0; i < arr.length; i++) {
			arr[i] = list.get(i);
		}
		return arr;
	}

	char[] charsort(char arr[]) {
		ArrayList<Character> list = new ArrayList<>();
		for (char c : arr)
			list.add(c);
		Collections.sort(list);
		for (int i = 0; i < list.size(); i++) {
			arr[i] = list.get(i);
		}
		return arr;
	}

	long[] longsort(long arr[]) {
		ArrayList<Long> list = new ArrayList<Long>();
		for (long i : arr)
			list.add(i);
		Collections.sort(list);
		for (int i = 0; i < arr.length; i++) {
			arr[i] = list.get(i);
		}
		return arr;
	}

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

	public int[] readArray(int left,int right) {
		int[] arr = new int[right-left+1];
		for (int i = left; i <=right; i++)
			arr[i] = nextInt();
		return arr;
	}

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

	public long[] longreadArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}
