#include #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; using lint=long long; class mint{ static const int MOD=1e9+7; int x; public: mint():x(0){} mint(long long y){ x=y%MOD; if(x<0) x+=MOD; } mint& operator+=(const mint& m){ x+=m.x; if(x>=MOD) x-=MOD; return *this; } mint& operator-=(const mint& m){ x-=m.x; if(x< 0) x+=MOD; return *this; } mint& operator*=(const mint& m){ x=1LL*x*m.x%MOD; return *this; } mint& operator/=(const mint& m){ return *this*=inverse(m); } mint operator+(const mint& m)const{ return mint(*this)+=m; } mint operator-(const mint& m)const{ return mint(*this)-=m; } mint operator*(const mint& m)const{ return mint(*this)*=m; } mint operator/(const mint& m)const{ return mint(*this)/=m; } mint operator-()const{ return mint(-x); } friend mint inverse(const mint& m){ int a=m.x,b=MOD,u=1,v=0; while(b>0){ int t=a/b; a-=t*b; swap(a,b); u-=t*v; swap(u,v); } return u; } friend istream& operator>>(istream& is,mint& m){ long long t; is>>t; m=mint(t); return is; } friend ostream& operator<<(ostream& os,const mint& m){ return os<0;k>>=1,m*=m) if(k&1) res*=m; return res; } lint modpow(lint a,lint k,int m){ lint r=1; for(lint x=a%m;k>0;k>>=1,x=x*x%m) if(k&1) r=r*x%m; return r; } int main(){ int a,b,n; scanf("%d%d%d",&a,&b,&n); static int f[10000001]; for(int g=b;g>=2;g--){ f[g]=modpow(b/g-(a-1)/g,n,1000000006); for(int h=2*g;h<=b;h+=g) f[g]-=f[h]; } mint ans=1; for(int g=2;g<=b;g++) ans*=pow(mint(g),f[g]); cout<