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