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