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 sys
import math
import operator as op
from functools import reduce
from bisect import *

## I/O ##
def read_line():
    return sys.stdin.readline()[:-1]
 
def read_int():
    return int(sys.stdin.readline())
    
def read_int_line():
    return [int(v) for v in sys.stdin.readline().split()]

def read_float_line():
    return [float(v) for v in sys.stdin.readline().split()]
## ##

## ncr ##
def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
## ##

## Fenwick Tree ##
N = int(1e6)+10
fenwick = [0]*N

def add(i,x,n):
	while i<n:
		fenwick[i]+=x
		i = i|(i+1)

def fsum(i,n):
	res = 0
	while i>=0:
		res += fenwick[i]
		i = (i&(i+1))-1
	return res

def fsum_range(i,j,n):
	return fsum(j,n)-fsum(i-1,n)
## ##	

## Main ##

mod = int(1e9)+7

# t = read_int()
t = 1
for i in range(t):
	n, l, r = read_int_line()
	dp = [[0,0,0] for i in range(n)]

	if r%3!=0 and l%3!=0:
		a1 = r//3 - l//3
	elif r%3!=0 and l%3==0:
		a1 = r//3 - l//3
	elif r%3==0 and l%3!=0:
		a1 = r//3 - l//3 - 1
	else:
		a1 = r//3 - l//3 - 1

	if l%3==0 and l!=r:
		a1+=1
	if r%3==0:
		a1+=1

	a2 = a1
	if l%3==1:
		a2+=1
	if r%3==0:
		a2-=1

	# a3 = a1
	# if l%3==2:
	# 	a3+=1
	# if r%3!=2:
	# 	a3-=1
	a3 = r-l+1 - a1 - a2

	dp[0][0] = a1%mod
	dp[0][1] = a2%mod
	dp[0][2] = a3%mod

	for i in range(1,n):
		dp[i][0] = (a1*dp[i-1][0] + dp[i-1][1]*a3 + dp[i-1][2]*a2)%mod
		dp[i][1] = (a2*dp[i-1][0] + dp[i-1][1]*a1 + dp[i-1][2]*a3)%mod
		dp[i][2] = (a3*dp[i-1][0] + dp[i-1][1]*a2 + dp[i-1][2]*a1)%mod

	print(dp[n-1][0])

