#include using namespace std; #define rep(i,n) for(int i=0;i=0;--i) #define debug(output) if(debugFlag)cout<<#output<<"= "< P; const bool debugFlag=true; const lint linf=1.1e18;const int inf=1.01e9; constexpr int MOD=1000000007; templatebool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; } templatebool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; } #include using namespace atcoder; using mint = modint; signed main(){ lint l,r,m;cin>>l>>r>>m; modint::set_mod(m); mint res=0; vector kaijo(m+100,0),dp(m+100,0); kaijo[0]=1; rep1(i,m)kaijo[i]=kaijo[i-1]*i; dp[0]=1; rep1(i,m)dp[i]=dp[i-1]*kaijo[i]; for(lint i=l;i<=r;++i){ if(i>=m)break; res+=dp[i]; } cout<