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.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        int t;
        //t = in.nextInt();
        t = 1;
        while (t > 0) {
            solver.call(in,out);
            t--;
        }
        out.close();
    }

    static class TaskA {
        int n, l, r;
        long[][] dp;

        public void call(InputReader in, PrintWriter out) {
            n = in.nextInt();
            l = in.nextInt();
            r = in.nextInt();

            dp = new long[n + 1][5];

            for (int i = 0; i <= n; i++) {
                Arrays.fill(dp[i], -1);
            }
            long ans = 0;
            ans+= (1 + (r- l)/3) *ans(1,l % 3) % 1000000007;
            if(l+1<=r){
                ans+= (1 + (r- l-1)/3) *ans(1,(l+1) % 3) % 1000000007;
            }
            if(l+2<=r){
                ans+= (1 + (r- l-2)/3) *ans(1,(l+2) % 3) % 1000000007;
            }
            out.println(ans%1000000007);
        }

        public long ans(int i, int a) {

            if (i >= n) {
                if(a!=0)
                    return 0;
                return 1;
            }

            if(dp[i][a]!=-1){
                return dp[i][a]%1000000007;
            }

            long opt1 = 0;

            opt1 += (1 + (r- l)/3) *ans(i+1 ,(a + l)%3 )%1000000007 ;

            if(l+1<=r){
                opt1 += (1 + (r- l-1)/3) *ans(i+1 ,(a + l+1)%3)%1000000007 ;
            }

            if(l+2<=r){
                opt1 += (1 + (r- l-2)/3) *ans(i+1 ,(a + l+2)%3)%1000000007 ;
            }

            return dp[i][a] = opt1%1000000007;

        }
    }

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

    static int lcm(int a, int b)
    {
        return (a / gcd(a, b)) * b;
    }

    static class answer implements Comparable<answer>{
        int a,b;

        public answer(int a, int b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(answer o) {
            if(this.a==o.a){
                return  this.b - o.b;
            }
            return this.a - o.a;
        }
    }

    static class arrayListClass {
        ArrayList<Integer> arrayList2 ;

        public arrayListClass(ArrayList<Integer> arrayList) {
            this.arrayList2 = arrayList;
        }
    }

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

    static void sort(long[] a) {
        ArrayList<Long> l=new ArrayList<>();
        for (long i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

    static final Random random=new Random();

    static void shuffleSort(int[] a) {
        int n=a.length;
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong(){
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }
}