a, b, t = [int(i) for i in input().split()] av_virus = 1 residual_t = t scaling = 2 base = ((a+b) ** 1) // (2 ** 1) while(residual_t > scaling): new_mult = base factor = 1 while(factor * scaling <= residual_t): factor *= scaling new_mult = new_mult ** scaling new_mult = new_mult % ((10 ** 9) + 7) av_virus *= new_mult av_virus = av_virus % ((10 ** 9) + 7) residual_t -= factor #while(residual_t > scaling): # fast_t = 1 # fast_factor = base # while(fast_t*scaling <= residual_t): # fast_factor = fast_factor ** scaling # av_virus *= fast_factor # av_virus = av_virus % ((10 ** 9) + 7) # fast_t *= scaling #fast_factor = int(float(residual_t) / fast_t) #av_virus *= ((a+b) ** fast_factor) // (2 ** fast_factor) #av_virus = av_virus % ((10 ** 9) + 7) #fast_t *= fast_factor # residual_t -= fast_t av_virus *= base ** residual_t av_virus = av_virus % ((10 ** 9) + 7) print(int(av_virus))