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

import static java.lang.Long.min;

public class Main {

    BufferedReader br;
    StringTokenizer in;
    PrintWriter pw;
    long mod = (long) (1e9 + 7);

    public void solve() throws IOException {
        int n = nextInt();
        int l = nextInt();
        int r = nextInt();
        int rr = r - r % 3; // last :3
        int ll = l + (3 - l % 3) % 3; // first :3
        int c = rr - ll + 1;
        long zero = 0;
        long one = 0;
        long two = 0;
        if (rr < l || ll > r) {
            for (int i = l; i <= r; i++) {
                if (i%3 == 0) zero++;
                if (i%3 == 1) one++;
                if (i%3 == 2) two++;
            }
        } else {
            zero = c / 3 + 1;
            one = c / 3;
            two = c / 3;
            while (rr != r) {
                rr++;
                if (rr % 3 == 1) one++;
                if (rr % 3 == 2) two++;
            }
            while (ll != l) {
                ll--;
                if (ll % 3 == 1) one++;
                if (ll % 3 == 2) two++;
            }
        }
        long d[][] = new long[n][3];
        d[0][0] = zero;
        d[0][1] = one;
        d[0][2] = two;
        for (int i = 1; i < n; i++) {
            d[i][0] = d[i - 1][0] * zero + d[i - 1][1] * two + d[i - 1][2] * one;
            d[i][1] = d[i - 1][0] * one + d[i - 1][1] * zero + d[i - 1][2] * two;
            d[i][2] = d[i - 1][0] * two + d[i - 1][1] * one + d[i - 1][2] * zero;
            for (int j = 0; j < 3; j++) {
                d[i][j] %= mod;
            }
        }
        pw.print(d[n - 1][0]);

    }

    String req(int a, int b) throws IOException {
        pw.println("? " + a + " " + b);
        pw.flush();
        return nextToken();
    }

    public void run() {
        try {
//            br = new BufferedReader(new FileReader("deletion.in"));
//            pw = new PrintWriter(new FileWriter("deletion.out"));
            br = new BufferedReader(new InputStreamReader(System.in));
            pw = new PrintWriter(new OutputStreamWriter(System.out));
//            br = new BufferedReader(new FileReader("input.txt"));
//            pw = new PrintWriter(new FileWriter("output.txt"));
            solve();
            pw.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    public String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

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

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

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


    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        new Main().run();
    }
}