A,B,N = map(int,input().split()) stack = list(range(A,B+1)) def gcd(a,b): while True: r = a % b a = b b = r if r == 0:return a P = 10 ** 9 + 7 for _ in range(5): l = [] for v in stack: for j in range(A,B+1): l.append(gcd(v,j)) stack = l ans = 1 for v in stack: ans = ans * v % P print(ans)