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