from itertools import product as P from math import gcd mod = 10**9+7 def main(): a, b, n = list(map(int, input().split())) ans = 1 for per in P(range(a, b+1), repeat = n): t = 0 for p in per: t = gcd(t, p) ans = ans * t % mod return ans print(main())