#include using namespace std; #pragma GCC optimize("Ofast") #define rep(i,n) for(ll i=0;i=0;i--) #define perl(i,r,l) for(ll i=r-1;i>=l;i--) #define fi first #define se second #define pb push_back #define ins insert #define pqueue(x) priority_queue,greater> #define all(x) (x).begin(),(x).end() #define CST(x) cout<; using vvl=vector>; using pl=pair; using vpl=vector; using vvpl=vector; const ll MOD=1000000007; const ll MOD9=998244353; const int inf=1e9+10; const ll INF=4e18; const ll dy[8]={1,0,-1,0,1,1,-1,-1}; const ll dx[8]={0,1,0,-1,1,-1,1,-1}; template inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll now=0; vl len(61),sum(61),prod(61),centlen(61); vector cent(61); len[0]=0;sum[0]=0;prod[0]=1; for(ll i=1;i<=60;i++){ string f=to_string(i*i); ll digsum=0,digprod=1; rep(i,f.size()){ ll q=f[i]-'0';if(q==0)q=10; digsum+=q; digprod*=q; } cent[i]=f; centlen[i]=f.size(); len[i]=len[i-1]*2+f.size(); sum[i]=sum[i-1]*2+digsum; prod[i]=(prod[i-1]*prod[i-1])%MOD*digprod%MOD; } ll k,l,r;cin >> k >> l >> r;l--;k=min(k,60LL); if(len[k]ll{ if(l>=r)return 0; if(l==0&&r==len[v])return sum[v]; if(r<=len[v-1])return self(self,v-1,l,r); if(len[v-1]+centlen[v]<=l)return self(self,v-1,l-len[v-1]-centlen[v],r-len[v-1]-centlen[v]); ll ns=0; for(ll i=len[v-1];ill{ if(l>=r)return 1; if(l==0&&r==len[v])return prod[v]; if(r<=len[v-1])return self(self,v-1,l,r); if(len[v-1]+centlen[v]<=l)return self(self,v-1,l-len[v-1]-centlen[v],r-len[v-1]-centlen[v]); ll ns=1; for(ll i=len[v-1];i