from itertools import * from math import * A, B, N = map(int, input().split()) mod = 10 ** 9 + 7 ans = 1 for tup in product(range(A, B + 1), repeat=N): g = tup[0] for i in range(1, N): g = gcd(g, tup[i]) ans *= g ans %= mod print(ans)