#include using namespace std; using Int = long long; const char newl = '\n'; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a void drop(const T &x){cout< vector read(size_t n){ vector ts(n); for(size_t i=0;i>ts[i]; return ts; } template struct Trie{ struct Node{ char c; array nxt; vector idxs; int idx; Node(char c):c(c),idx(-1){fill(nxt.begin(),nxt.end(),-1);} }; using F = function; vector vs; F conv; Trie(F conv,char c='$'):conv(conv){vs.emplace_back(c);} inline int &next(int i,int j){ return vs[i].nxt[j]; } void add(const string &s,int x){ int pos=0; for(int i=0;i<(int)s.size();i++){ int k=conv(s[i]); if(~next(pos,k)){ pos=next(pos,k); continue; } int npos=vs.size(); next(pos,k)=npos; vs.emplace_back(s[i]); pos=npos; } vs[pos].idx=x; vs[pos].idxs.emplace_back(x); } int find(const string &s){ int pos=0; for(int i=0;i<(int)s.size();i++){ int k=conv(s[i]); if(next(pos,k)<0) return -1; pos=next(pos,k); } return pos; } int move(int pos,char c){ assert(pos<(int)vs.size()); return pos<0?-1:next(pos,conv(c)); } int size(){return vs.size();} int idx(int pos){ return pos<0?-1:vs[pos].idx; } vector idxs(int pos){ return pos<0?vector():vs[pos].idxs; } }; template struct AhoCorasick : Trie{ using TRIE = Trie; using TRIE::TRIE; using TRIE::next; vector cnt; void build(int heavy=true){ auto &vs=TRIE::vs; int n=vs.size(); cnt.resize(n); for(int i=0;i que; for(int i=0;i<(int)X;i++){ if(~next(0,i)){ next(next(0,i),X)=0; que.emplace(next(0,i)); }else{ next(0,i)=0; } } while(!que.empty()){ auto &x=vs[que.front()]; int fail=x.nxt[X]; cnt[que.front()]+=cnt[fail]; que.pop(); for(int i=0;i<(int)X;i++){ int &nx=x.nxt[i]; if(nx<0){ nx=next(fail,i); continue; } que.emplace(nx); next(nx,X)=next(fail,i); if(heavy){ auto &idx=vs[nx].idxs; auto &idy=vs[next(fail,i)].idxs; vector idz; set_union(idx.begin(),idx.end(), idy.begin(),idy.end(), back_inserter(idz)); idx=idz; } } } } vector match(string s,int heavy=true){ auto &vs=TRIE::vs; vector res(heavy?TRIE::size():1); int pos=0; for(auto &c:s){ pos=next(pos,TRIE::conv(c)); if(heavy) for(auto &x:vs[pos].idxs) res[x]++; else res[0]+=cnt[pos]; } return res; } int count(int pos){ return cnt[pos]; } }; template struct Mint{ static constexpr T mod = MOD; T v; Mint():v(0){} Mint(signed v):v(v){} Mint(long long t){v=t%MOD;if(v<0) v+=MOD;} Mint pow(long long k){ Mint res(1),tmp(v); while(k){ if(k&1) res*=tmp; tmp*=tmp; k>>=1; } return res; } static Mint add_identity(){return Mint(0);} static Mint mul_identity(){return Mint(1);} Mint inv(){return pow(MOD-2);} Mint& operator+=(Mint a){v+=a.v;if(v>=MOD)v-=MOD;return *this;} Mint& operator-=(Mint a){v+=MOD-a.v;if(v>=MOD)v-=MOD;return *this;} Mint& operator*=(Mint a){v=1LL*v*a.v%MOD;return *this;} Mint& operator/=(Mint a){return (*this)*=a.inv();} Mint operator+(Mint a) const{return Mint(v)+=a;} Mint operator-(Mint a) const{return Mint(v)-=a;} Mint operator*(Mint a) const{return Mint(v)*=a;} Mint operator/(Mint a) const{return Mint(v)/=a;} Mint operator-() const{return v?Mint(MOD-v):Mint(v);} bool operator==(const Mint a)const{return v==a.v;} bool operator!=(const Mint a)const{return v!=a.v;} bool operator <(const Mint a)const{return v constexpr T Mint::mod; template ostream& operator<<(ostream &os,Mint m){os< struct FixPoint : F{ FixPoint(F&& f):F(forward(f)){} template decltype(auto) operator()(Args&&... args) const{ return F::operator()(*this,forward(args)...); } }; template inline decltype(auto) MFP(F&& f){ return FixPoint{forward(f)}; } template vector make_v(size_t a){return vector(a);} template auto make_v(size_t a,Ts... ts){ return vector(ts...))>(a,make_v(ts...)); } template typename enable_if::value!=0>::type fill_v(U &u,const V... v){u=U(v...);} template typename enable_if::value==0>::type fill_v(U &u,const V... v){ for(auto &e:u) fill_v(e,v...); } //INSERT ABOVE HERE signed main(){ cin.tie(0); ios::sync_with_stdio(0); using ll = long long; ll n,l,r; cin>>n>>l>>r; auto f=[&](char c){return c-'0';}; AhoCorasick<10> aho(f); { ll a=1,b=1; if(l<=a and a<=r) aho.add(to_string(a),0); while(a<=r){ if(l<=a) aho.add(to_string(a),0); ll c=a+b; a=b; b=c; } } aho.build(false); using M = Mint; auto dp=make_v(n,aho.size()); auto used=make_v(n,aho.size()); fill_v(used,0); MFP([&](auto dfs,int d,int cur)->M{ if(d==n) return M(1); M &res=dp[d][cur]; if(used[d][cur]) return res; used[d][cur]=1; res=0; for(int i=0;i<10;i++){ int nxt=aho.move(cur,'0'+i); if(aho.count(nxt)) continue; res+=dfs(d+1,nxt); } return res; })(0,0); cout<