#include using namespace std; typedef long long ll; ll m; vector memo(1000007,-1); ll mfac(ll x){ if(memo[x]!=-1)return memo[x]; if(x==0)return 1; return memo[x]=(x*mfac(x-1))%m; } int main(){ ll l,r; cin>>l>>r>>m; if(l>=m){ cout<<0<