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

public class Q3 {

	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
	
	static class FastScanner {
	    private InputStream stream;
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int numChars;
	    private SpaceCharFilter filter;
	 
	    public FastScanner(InputStream stream) {
	        this.stream = stream;
	    }
	 
	    public static boolean isWhitespace(int c) {
	        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	    }
	 
	    public int read() {
	        if (numChars == -1)
	            throw new InputMismatchException();
	        if (curChar >= numChars) {
	            curChar = 0;
	            try {
	                numChars = stream.read(buf);
	            } catch (IOException e) {
	                throw new InputMismatchException();
	            }
	            if (numChars <= 0)
	                return -1;
	        }
	        return buf[curChar++];
	    }
	 
	    public int nextInt() {
	        int c = read();
	        while (isSpaceChar(c))
	            c = read();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = read();
	        }
	        int res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c - '0';
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }
	 
	    public long nextLong() {
	        int c = read();
	        while (isSpaceChar(c))
	            c = read();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = read();
	        }
	        long res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c - '0';
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }
	 
	    public String nextToken() {
	        int c = read();
	        while (isSpaceChar(c))
	            c = read();
	        StringBuilder res = new StringBuilder();
	        do {
	            res.appendCodePoint(c);
	            c = read();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }
	 
	    public boolean isSpaceChar(int c) {
	        if (filter != null)
	            return filter.isSpaceChar(c);
	        return isWhitespace(c);
	    }
	 
	    public interface SpaceCharFilter {
	        public boolean isSpaceChar(int ch);
	    }
	}
	
	static class Pair implements Comparable<Pair> {
		int u, v;
		
		public Pair(int u, int v) {
			this.u = u;
			this.v = v;
		}
		
		public int compareTo(Pair o) {
			return Integer.compare(u, o.u) != 0 ? Integer.compare(u, o.u) : Integer.compare(v, o.v);
		}
	}
	
	static long m = (long)1e9 + 7;
	
	public static void main(String[] args) throws Exception {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		long l = fs.nextLong(), r = fs.nextLong();
		long[] count = new long[3];
		count[0] = f(r, 0) - f(l-1, 0);
		count[1] = f(r, 1) - f(l-1, 1);
		count[2] = f(r, 2) - f(l-1, 2);
		
		long[][] dp = new long[n+1][3];
		dp[0][0] = 1;
		for(int i=0; i<n; i++)
			for(int j=0; j<3; j++)
				for(int k=0; k<3; k++)
					dp[i+1][(j+k)%3] = (dp[i+1][(j+k)%3] + (dp[i][j]%m * count[k]%m)%m)%m;
		
		pw.println(dp[n][0]);
		pw.flush();
		pw.close();
	}
	
	static long f(long a, long b) {
		if(a < b)
			return 0;
		
		return (a - b)/3 + 1;
	}
}