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 javafx.util.Pair;

import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    class FastScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;
        public FastScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }
        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()){
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException ignored){}
            }
            return stringTokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    private FastScanner scanner;
    private PrintWriter printer;

    Main(InputStream scanner, PrintWriter printWriter) {
        this.scanner = new FastScanner(scanner);
        this.printer = printWriter;
    }

    int gcd (int a, int b) {
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    boolean isPrime(int n) {
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

    List<Integer>prostMnoj(int n) {
        ArrayList<Integer> r = new ArrayList<>();
        int p = 2;
        while(n != 1) {
            while(n % p == 0) {
                n /= p;
                r.add(p);
            }
            p++;
            while(!isPrime(p)) {
                p++;
            }
        }
        return r;
    }

    List<Integer>allMnoj(List<Integer>a) {
        ArrayList<Integer>r = new ArrayList<>();
        boolean b[] = new boolean[a.size() + 1];
        while(!b[0]) {
            int i = a.size();
            while(b[i]) {
                i--;
            }
            b[i++] = true;
            while(i<b.length) {
                b[i++] = false;

            }
            int m = 1;
            for (i = 1; i < b.length; i++) {
                if (b[i]) {
                    m*=a.get(i-1);
                }
            }
            r.add(m);
        }
        return r;
    }

    double a(long n) {
        return (180.0 * (n-2)) / n;
    }

    void next (int a[]) {
        for (int i = a.length - 2; i >= 0; i--) {
            if (a[i] < a[i+1]) {
                for (int j = a.length - 1;; j--) {
                    if (a[j] > a[i]) {
                        int t = a[i];
                        a[i] = a[j];
                        a[j] = t;
                        break;
                    }
                }
                for (int j = i + 1; j <= i + ((a.length - 1) - i) / 2; j++) {
                    int t = a[j];
                    int k = (a.length - 1) - (j - (i + 1));
                    a[j] = a[k];
                    a[k] = t;
                }
                break;
            }
        }
    }

    int fact(int n) {
        if (n == 1) return 1;
        return n * fact(n - 1);
    }

    int dfs(List<List<Integer>>g, int v, boolean used[]) {
        if (used[v]) return 0;
        used[v] = true;
        int sum = 1;
        for (int i = 0; i < g.get(v).size(); i++) {
            sum += dfs(g, g.get(v).get(i), used);
        }
        return sum;
    }

    int find(List<List<Integer>>g, int v, int x, boolean used[]) {
        if (used[v]) return -1;
        used[v] = true;
        if (g.get(v).contains(x)) return v;
        for (int i = 0; i < g.get(v).size(); i++) {
            int res = find(g, g.get(v).get(i), x, used);
            if (res != -1) return res;
        }
        return -1;
    }

    int dp[] = new int[101];
    {
        Arrays.fill(dp, -1);
    }

    int[] ms(int n) {
        int dp[] = new int[n + 1];
        int tp[] = new int[n + 1];
        dp[1] = 0;
        tp[1] = 1;
        for (int i = 2; i <= n; i++) {
            int t = i - 1;
            dp[i] = dp[i - 1];
            if (i % 2 == 0 && dp[i / 2] < dp[i]) {
                dp[i] = dp[i / 2];
                t = i / 2;
            }
            if (i % 3 == 0 && dp[i / 3] < dp[i]) {
                dp[i] = dp[i / 3];
                t = i / 3;
            }
            dp[i]++;
            tp[i] = t;
        }
        printer.println(dp[n]);
        int t = n;
        StringBuilder s = new StringBuilder();
        while (t != 1) {
            s.insert(0, t);
            s.insert(0, " ");
            t = tp[t];
        }
        s.insert(0, "1");
        printer.println(s);
        return dp;
    }

    double gg(List<List<Integer>>g, boolean used[], int v) {
        List<Integer> gv = g.get(v);
        used[v] = true;
        if (gv.isEmpty()) return 0;
        if (gv.size() == 1 && used[gv.get(0)]) {
            return 0;
        }
        int k = 0;
        double sum = 0;
        for (int i = 0; i < gv.size(); i++) {
            if (!used[gv.get(i)]) {
                sum += gg(g, used, gv.get(i));
                k++;
            }
        }
        return sum / k + 1;
    }

    long fib(long n)
    {
        if (n < 1) return 0;
        long a = 0;
        long b = 1;
        for (int i = 2; i <= n; i++) {
            long t = a + b;
            a = b;
            b = t;
        }
        return b;
    }

    List<List<Integer>>g = new ArrayList<>();
    int d[];
    int a[];

    int dist(int x, int y) {
        return 0;
    }

    int ggg(int v) {
        if (d[v] == -1) {
            d[v] = 1;
            int x = a[v];
            for (int i = 0; i < g.get(v).size(); i++) {
                d[v] = Math.max(d[v], gcd(x, ggg(g.get(v).get(i))));
            }
        }
        return d[v];
    }

    int dd[][] = new int[200001][3];
    {
        for (int i = 0; i < dd.length; i++) {
            Arrays.fill(dd[i], -1);
        }
    }

    final int mod = 1_000_000_007;


    int f(int n, int i, int s, int l, int r) {
        if (dd[i][s] == -1) {
            if (i == n - 1) {
                int j = l;
                while ((s + j) % 3 != 0) {
                    j++;
                }
                if (j > r) dd[i][s] =  0;
                else dd[i][s] = (1 + (r - j) / 3) % mod;
            } else {
                long plus0 = (long)(Math.ceil((r - (l + 0) + 1) / 3.0) % mod);
                long plus1 = (long)(Math.ceil((r - (l + 1) + 1) / 3.0) % mod);
                long plus2 = (long)(Math.ceil((r - (l + 2) + 1) / 3.0) % mod);
                long k1 = (f(n, i + 1, (s + l + 0) % 3, l, r) * plus0) % mod;
                long k2 = (f(n, i + 1, (s + l + 1) % 3, l, r) * plus1) % mod;
                long k3 = (f(n, i + 1, (s + l + 2) % 3, l, r) * plus2) % mod;
                dd[i][s] = (int)(((k1 + k2) % mod) + k3) % mod;
            }
        }
        return dd[i][s] % mod;
    }

    void run() {
        int n = scanner.nextInt();
        int l = scanner.nextInt();
        int r = scanner.nextInt();
        printer.println(f(n, 0, 0, l, r));
        printer.flush();
        printer.close();
    }

    public static void main(String [] args) {
        long start = System.currentTimeMillis();
        new Main(System.in, new PrintWriter(System.out)).run();
        long finish = System.currentTimeMillis();
        System.err.println(finish - start + "ms");
    }
}