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.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Created by timur on 28.03.15.
 */

public class TaskC {
    boolean eof;
    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;

    public static void main(String[] args) throws IOException {
        new TaskC().run();
    }

    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return "-1";
            }
        }
        return st.nextToken();
    }

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

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

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }

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


    void run() throws IOException {
        InputStream input = System.in;
        PrintStream output = System.out;
        try {
            File f = new File("a.in");
            if (f.exists() && f.canRead()) {
                input = new FileInputStream(f);
                output = new PrintStream("a.out");
            }
        } catch (Throwable e) {
        }
        br = new BufferedReader(new InputStreamReader(input));
        out = new PrintWriter(output);
        solve();
        br.close();
        out.close();
    }

    class Pair implements Comparable<Pair> {
        int l, r, ind;

        public Pair(int l, int r, int ind) {
            this.l = l;
            this.r = r;
            this.ind = ind;
        }

        @Override
        public int compareTo(Pair o) {
            int r = l - o.l;
            if (r == 0)
                r = o.r - this.r;
            return r;
        }
    }

    void solve() {
        int n = nextInt(), l = nextInt(), r = nextInt();
        long mod = 1000000007;
        long[] a = new long[n];
        long[] b = new long[n];
        long[] c = new long[n];
        long[] lrc = new long[3];
        lrc[0] = r / 3 - (l - 1) / 3;
        lrc[1] = (r + 2) / 3 - (l - 1 + 2) / 3;
        lrc[2] = (r + 1) / 3 - (l - 1 + 1) / 3;
        lrc[0] %= mod;
        lrc[1] %= mod;
        lrc[2] %= mod;
//        out.println(lrc[0]);
//        out.println(lrc[1]);
//        out.println(lrc[2]);
        a[0] = lrc[0];
        b[0] = lrc[1];
        c[0] = lrc[2];

        for (int i = 1; i < n; i++) {
            a[i] = (a[i - 1] * lrc[0] + b[i - 1] * lrc[2] + c[i - 1] * lrc[1]) % mod;
            b[i] = (a[i - 1] * lrc[1] + b[i - 1] * lrc[0] + c[i - 1] * lrc[2]) % mod;
            c[i] = (a[i - 1] * lrc[2] + b[i - 1] * lrc[1] + c[i - 1] * lrc[0]) % mod;
        }
        
        out.println(a[n - 1] % mod);
    }
}