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.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {
	static int mod = (int)1e9+7;
	static int [][] memo;
	static int n, l, r;
	static long [] numWays;
	static int dp(int idx, int mod){
		if(idx == n)
			return mod == 0?1:0;
		if(memo[idx][mod] != -1)
			return memo[idx][mod];
		long ans = add(mul(dp(idx+1, mod), numWays[0]),
				add(mul(dp(idx+1, (mod+1)%3), numWays[1]), mul(dp(idx+1, (mod+2)%3), numWays[2])));
		return memo[idx][mod] = (int)ans;
	}
	static long add(long a, long b){
		return (a + b) % mod;
	}
	static long mul(long a, long b){
		return (a * b) % mod;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		n = sc.nextInt(); l = sc.nextInt(); r = sc.nextInt();
		memo = new int[n+1][3];
		for(int [] i:memo)
			Arrays.fill(i, -1);
		numWays = new long[3];
		for (int i = 0; i < numWays.length; ++i) {
			int l3 = -1, r3 = -1;
			for (int j = 0; j < 3; ++j) {
				// add j to l
				if(l + j <= r){
					if((l + j) % 3 == i){
						l3 = (l+j) / 3;
					}
				}
				// sub j from r
				if(r - j >= l){
					if((r - j) % 3 == i){
						r3 = (r-j) / 3;
					}
				}
			}
			if(l3 == -1 || r3 == -1)
				numWays[i] = 0;
			else
				numWays[i] = r3 - l3 + 1;
		}
		out.println(dp(0, 0));
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

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

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

	}

}
