A, B, N = map(int, input().split()) mod = 10 ** 9 + 7 mod2 = 10 ** 9 + 6 A -= 1 B1 = B + 1 cnt = [0] * B1 for i in range(1, B1): cnt[i] = pow(B // i - A // i, N, mod2) for i in range(B // 2, 1, -1): for n in range(2 * i, B1, i): cnt[i] -= cnt[n] cnt[i] %= mod2 ret = 1 for i in range(2, B1): ret = ret * pow(i, cnt[i], mod) % mod print(ret)