from collections import * from itertools import * from functools import * from heapq import * import sys input = sys.stdin.readline A,B,N = map(int,input().split()) mod = 10**9 + 7 cnt = [0]*(B+1) for i in range(B,1,-1): cnt[i] += pow(B//i - (A-1)//i,N,mod) for j in range(i+i,B+1,i): cnt[i] -= cnt[j] cnt[i] %= (mod-1) ans = 1 for i in range(1,B+1): ans *= pow(i,cnt[i],mod) ans %= mod print(ans)