import math import itertools a,b,n=map(int,input().split()) def f(L): ret=0 for v in L: ret=math.gcd(ret, v) return ret MOD=10**9+7 ans=1 for L in itertools.product(range(a,b+1),repeat=n): ans=ans*f(L)%MOD print(ans)