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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jenish
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CAyoubAndLostArray solver = new CAyoubAndLostArray();
        solver.solve(1, in, out);
        out.close();
    }

    static class CAyoubAndLostArray {
        long mod = (long) (1e9 + 7);

        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            long n = in.scanLong();
            long l = in.scanLong();
            long r = in.scanLong();
            long zero = (r) / 3;
            long one = (r + 2) / 3;
            long two = (r + 1) / 3;
            zero -= (l - 1) / 3;
            one -= (l - 1 + 2) / 3;
            two -= (l) / 3;

            long dp[][] = new long[(int) (n + 1)][3];
            dp[1][0] = zero;
            dp[1][1] = one;
            dp[1][2] = two;


            for (int i = 2; i <= n; i++) {
                dp[i][0] = (dp[i][0] + (zero * dp[i - 1][0]) % mod) % mod;
                dp[i][0] = (dp[i][0] + (two * dp[i - 1][1]) % mod) % mod;
                dp[i][0] = (dp[i][0] + (one * dp[i - 1][2]) % mod) % mod;

                dp[i][1] = (dp[i][1] + (zero * dp[i - 1][1]) % mod) % mod;
                dp[i][1] = (dp[i][1] + (one * dp[i - 1][0]) % mod) % mod;
                dp[i][1] = (dp[i][1] + (two * dp[i - 1][2]) % mod) % mod;

                dp[i][2] = (dp[i][2] + (one * dp[i - 1][1]) % mod) % mod;
                dp[i][2] = (dp[i][2] + (zero * dp[i - 1][2]) % mod) % mod;
                dp[i][2] = (dp[i][2] + (two * dp[i - 1][0]) % mod) % mod;

            }
            out.println(dp[(int) n][0]);

        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int INDEX;
        private BufferedInputStream in;
        private int TOTAL;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (INDEX >= TOTAL) {
                INDEX = 0;
                try {
                    TOTAL = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (TOTAL <= 0) return -1;
            }
            return buf[INDEX++];
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

        public long scanLong() {
            long I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

    }
}

