import sys readline = sys.stdin.readline N, L, R = map(int, readline().split()) Fib = [] a, b = 1, 1 while b <= R: Fib.append(b) a, b = b, a+b L -= 1 a, b = 1, 1 while b <= L: Fib.remove(b) a, b = b, a+b Fib = [list(map(int, str(s))) for s in Fib] S = set() S.add(tuple()) banned = set() for f in Fib: for l in range(len(f)): S.add(tuple(f[:l+1])) banned.add(tuple(f)) D = dict() Di = dict() for i in range(len(S)): s = S.pop() D[s] = i Di[i] = s emp = D[tuple()] Edge = [] for i in range(len(Di)): s = list(Di[i]) E = [] for num in range(10): t = tuple(s+[num]) lt = len(t) for ti in range(lt+1): if t[ti:] in banned: break else: for ti in range(lt+1): if t[ti:] in D: E.append(D[t[ti:]]) break Edge.append(E) LD = len(D) dp = [0]*LD dp[emp] = 1 MOD = 10**9+7 for _ in range(N): dp2 = [0]*LD for j in range(LD): dj = dp[j] if not dj: continue for e in Edge[j]: dp2[e] = (dp2[e] + dj)%MOD dp = dp2[:] print((sum(dp)-1)%MOD)