import sys, re, os from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import permutations, combinations, product, accumulate from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_uppercase, digits from fractions import gcd from bisect import bisect, bisect_left, bisect_right from functools import reduce def input(): return sys.stdin.readline().strip() def INT(): return int(input()) def MAP(): return map(int, input().split()) def S_MAP(): return map(str, input().split()) def LIST(): return list(map(int, input().split())) def S_LIST(): return list(map(str, input().split())) sys.setrecursionlimit(10 ** 9) INF = float('inf') mod = 10 ** 9 + 7 A, B, N = MAP() # L = [n for n in range(A, B + 1)] #生成する数字 # num = 3 #生成するビット数 bit_list = list(product(range(A, B + 1), repeat=N)) # print(bit_list) ans = 1 for l in bit_list: # for y in l: # print(y) b = reduce(gcd, l) ans *= b % mod ans %= mod print(ans) # for i in range(A, B+1): # b = reduce(gcd, i) # for i in range(N):