import sys

input = sys.stdin.readline



import numpy as np



MOD = 10**9 + 7



N,M,K = list(map(int,input().split()))



def cumprod(arr):

    L = len(arr); Lsq = int(L**.5+1)

    arr = np.resize(arr,Lsq**2).reshape(Lsq,Lsq)

    for n in range(1,Lsq):

        arr[:,n] *= arr[:,n-1]; arr[:,n] %= MOD

    for n in range(1,Lsq):

        arr[n] *= arr[n-1,-1]; arr[n] %= MOD

    return arr.ravel()[:L]



U = 10**6

x = np.full(U,2,dtype=np.int64); x[0] = 1

pow2 = cumprod(x)

x = np.full(U,3,dtype=np.int64); x[0] = 1

pow3 = cumprod(x)

x = np.full(U,pow(2,MOD-2,MOD),dtype=np.int64); x[0] = 1

pow2_inv = cumprod(x)

x = np.full(U,pow(3,MOD-2,MOD),dtype=np.int64); x[0] = 1

pow3_inv = cumprod(x)

x = np.arange(U,dtype=np.int64); x[0] = 1

fact = cumprod(x)

x = np.arange(U,0,-1,dtype=np.int64); x[0] = pow(int(fact[-1]),MOD-2,MOD)

fact_inv = cumprod(x)[::-1]



L = N+M

A = np.zeros(N+M,dtype=np.int64)

A[1:L] = (-1) * pow2[0:L-1] * pow3_inv[0:L-1] % MOD

A[1:L] *= fact[K+1:K+L] * fact_inv[K] % MOD * fact_inv[1:L] % MOD; A %= MOD

A[1:L] *= pow3_inv[K+1]; A %= MOD

A[0] = 3 * (1 - pow3_inv[K+1]) % MOD * pow2_inv[1] % MOD

np.cumsum(A,out=A); A %= MOD

A *= pow3[:L]; A %= MOD

A *= pow2_inv[:L]; A %= MOD



comb = fact[N-1:N+M] * fact_inv[:M+1] % MOD * fact_inv[N-1] % MOD

answer = (comb * pow3[K+M:K-1:-1] % MOD * A[N-1:N+M] % MOD).sum() % MOD

print(answer)
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



import numpy as np



N,M,K = list(map(int,read().split()))



MOD = 10 ** 9 + 7



def cumprod(arr,MOD):

    L = len(arr); Lsq = int(L**.5+1)

    arr = np.resize(arr,Lsq**2).reshape(Lsq,Lsq)

    for n in range(1,Lsq):

        arr[:,n] *= arr[:,n-1]; arr[:,n] %= MOD

    for n in range(1,Lsq):

        arr[n] *= arr[n-1,-1]; arr[n] %= MOD

    return arr.ravel()[:L]



def make_fact(U,MOD):

    x = np.arange(U,dtype=np.int64); x[0] = 1

    fact = cumprod(x,MOD)

    x = np.arange(U,0,-1,dtype=np.int64); x[0] = pow(int(fact[-1]),MOD-2,MOD)

    fact_inv = cumprod(x,MOD)[::-1]

    return fact,fact_inv



def make_power(a,L,MOD):

    B = L.bit_length()

    x = np.empty(1 + (1<<B),np.int64)

    x[0] = 1; x[1] = a

    for n in range(B):

        x[1<<n:1<<(n+1)] = x[:1<<n] * (a * x[(1<<n)-1] % MOD) % MOD

    return x[:L]



U = 10 ** 6

power2 = make_power(2,U,MOD)

power2_inv = make_power(pow(2,MOD-2,MOD),U,MOD)

power3 = make_power(3,U,MOD)

power3_inv = make_power(pow(3,MOD-2,MOD),U,MOD)

fact,fact_inv = make_fact(U,MOD)



x = np.zeros(N+M,np.int64)

x[1:] = (-1) * power2[:N+M-1] * power3_inv[K+1:N+M+K] % MOD

x[1:] *= fact[K+1:N+M+K] * fact_inv[K] % MOD * fact_inv[1:N+M] % MOD

x %= MOD

x[0] = 3 * (1 - power3_inv[K+1]) % MOD * power2_inv[1] % MOD

np.cumsum(x, out=x); x %= MOD

x *= power3[:N+M] * power2_inv[:N+M] % MOD; x %= MOD



coef = fact[N-1:N+M] * fact_inv[:M+1] % MOD * fact_inv[N-1] % MOD

coef *= power3[K:K+M+1][::-1]; coef %= MOD

answer = (coef * x[N-1:N+M] % MOD).sum() % MOD

print(answer)
import sys

input = sys.stdin.readline
import numpy as np

MOD = 10**9 + 7
N, M, K = list(map(int, input().split()))


def cumprod(arr):
    L = len(arr)
    Lsq = int(L**0.5 + 1)
    arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
    for n in range(1, Lsq):
        arr[:, n] *= arr[:, n - 1]
        arr[:, n] %= MOD
    for n in range(1, Lsq):
        arr[n] *= arr[n - 1, -1]
        arr[n] %= MOD
    return arr.ravel()[:L]


U = 10**6
x = np.full(U, 2, dtype=np.int64)
x[0] = 1
pow2 = cumprod(x)
x = np.full(U, 3, dtype=np.int64)
x[0] = 1
pow3 = cumprod(x)
x = np.full(U, pow(2, MOD - 2, MOD), dtype=np.int64)
x[0] = 1
pow2_inv = cumprod(x)
x = np.full(U, pow(3, MOD - 2, MOD), dtype=np.int64)
x[0] = 1
pow3_inv = cumprod(x)
x = np.arange(U, dtype=np.int64)
x[0] = 1
fact = cumprod(x)
x = np.arange(U, 0, -1, dtype=np.int64)
x[0] = pow(int(fact[-1]), MOD - 2, MOD)
fact_inv = cumprod(x)[::-1]
L = N + M
A = np.zeros(N + M, dtype=np.int64)
A[1:L] = (-1) * pow2[0 : L - 1] * pow3_inv[0 : L - 1] % MOD
A[1:L] *= fact[K + 1 : K + L] * fact_inv[K] % MOD * fact_inv[1:L] % MOD
A %= MOD
A[1:L] *= pow3_inv[K + 1]
A %= MOD
A[0] = 3 * (1 - pow3_inv[K + 1]) % MOD * pow2_inv[1] % MOD
np.cumsum(A, out=A)
A %= MOD
A *= pow3[:L]
A %= MOD
A *= pow2_inv[:L]
A %= MOD
comb = fact[N - 1 : N + M] * fact_inv[: M + 1] % MOD * fact_inv[N - 1] % MOD
answer = (comb * pow3[K + M : K - 1 : -1] % MOD * A[N - 1 : N + M] % MOD).sum() % MOD
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

N, M, K = list(map(int, read().split()))
MOD = 10**9 + 7


def cumprod(arr, MOD):
    L = len(arr)
    Lsq = int(L**0.5 + 1)
    arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
    for n in range(1, Lsq):
        arr[:, n] *= arr[:, n - 1]
        arr[:, n] %= MOD
    for n in range(1, Lsq):
        arr[n] *= arr[n - 1, -1]
        arr[n] %= MOD
    return arr.ravel()[:L]


def make_fact(U, MOD):
    x = np.arange(U, dtype=np.int64)
    x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64)
    x[0] = pow(int(fact[-1]), MOD - 2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    return fact, fact_inv


def make_power(a, L, MOD):
    B = L.bit_length()
    x = np.empty(1 + (1 << B), np.int64)
    x[0] = 1
    x[1] = a
    for n in range(B):
        x[1 << n : 1 << (n + 1)] = x[: 1 << n] * (a * x[(1 << n) - 1] % MOD) % MOD
    return x[:L]


U = 10**6
power2 = make_power(2, U, MOD)
power2_inv = make_power(pow(2, MOD - 2, MOD), U, MOD)
power3 = make_power(3, U, MOD)
power3_inv = make_power(pow(3, MOD - 2, MOD), U, MOD)
fact, fact_inv = make_fact(U, MOD)
x = np.zeros(N + M, np.int64)
x[1:] = (-1) * power2[: N + M - 1] * power3_inv[K + 1 : N + M + K] % MOD
x[1:] *= fact[K + 1 : N + M + K] * fact_inv[K] % MOD * fact_inv[1 : N + M] % MOD
x %= MOD
x[0] = 3 * (1 - power3_inv[K + 1]) % MOD * power2_inv[1] % MOD
np.cumsum(x, out=x)
x %= MOD
x *= power3[: N + M] * power2_inv[: N + M] % MOD
x %= MOD
coef = fact[N - 1 : N + M] * fact_inv[: M + 1] % MOD * fact_inv[N - 1] % MOD
coef *= power3[K : K + M + 1][::-1]
coef %= MOD
answer = (coef * x[N - 1 : N + M] % MOD).sum() % MOD
print(answer)

-input = sys.stdin.readline +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +N, M, K = list(map(int, read().split())) -N, M, K = list(map(int, input().split())) -def cumprod(arr): +def cumprod(arr, MOD): +def make_fact(U, MOD): +    x = np.arange(U, dtype=np.int64) +    x[0] = 1 +    fact = cumprod(x, MOD) +    x = np.arange(U, 0, -1, dtype=np.int64) +    x[0] = pow(int(fact[-1]), MOD - 2, MOD) +    fact_inv = cumprod(x, MOD)[::-1] +    return fact, fact_inv + + +def make_power(a, L, MOD): +    B = L.bit_length() +    x = np.empty(1 + (1 << B), np.int64) +    x[0] = 1 +    x[1] = a +    for n in range(B): +        x[1 << n : 1 << (n + 1)] = x[: 1 << n] * (a * x[(1 << n) - 1] % MOD) % MOD +    return x[:L] + + -x = np.full(U, 2, dtype=np.int64) -x[0] = 1 -pow2 = cumprod(x) -x = np.full(U, 3, dtype=np.int64) -x[0] = 1 -pow3 = cumprod(x) -x = np.full(U, pow(2, MOD - 2, MOD), dtype=np.int64) -x[0] = 1 -pow2_inv = cumprod(x) -x = np.full(U, pow(3, MOD - 2, MOD), dtype=np.int64) -x[0] = 1 -pow3_inv = cumprod(x) -x = np.arange(U, dtype=np.int64) -x[0] = 1 -fact = cumprod(x) -x = np.arange(U, 0, -1, dtype=np.int64) -x[0] = pow(int(fact[-1]), MOD - 2, MOD) -fact_inv = cumprod(x)[::-1] -L = N + M -A = np.zeros(N + M, dtype=np.int64) -A[1:L] = (-1) * pow2[0 : L - 1] * pow3_inv[0 : L - 1] % MOD -A[1:L] *= fact[K + 1 : K + L] * fact_inv[K] % MOD * fact_inv[1:L] % MOD -A %= MOD -A[1:L] *= pow3_inv[K + 1] -A %= MOD -A[0] = 3 * (1 - pow3_inv[K + 1]) % MOD * pow2_inv[1] % MOD -np.cumsum(A, out=A) -A %= MOD -A *= pow3[:L] -A %= MOD -A *= pow2_inv[:L] -A %= MOD -comb = fact[N - 1 : N + M] * fact_inv[: M + 1] % MOD * fact_inv[N - 1] % MOD -answer = (comb * pow3[K + M : K - 1 : -1] % MOD * A[N - 1 : N + M] % MOD).sum() % MOD +power2 = make_power(2, U, MOD) +power2_inv = make_power(pow(2, MOD - 2, MOD), U, MOD) +power3 = make_power(3, U, MOD) +power3_inv = make_power(pow(3, MOD - 2, MOD), U, MOD) +fact, fact_inv = make_fact(U, MOD) +x = np.zeros(N + M, np.int64) +x[1:] = (-1) * power2[: N + M - 1] * power3_inv[K + 1 : N + M + K] % MOD +x[1:] *= fact[K + 1 : N + M + K] * fact_inv[K] % MOD * fact_inv[1 : N + M] % MOD +x %= MOD +x[0] = 3 * (1 - power3_inv[K + 1]) % MOD * power2_inv[1] % MOD +np.cumsum(x, out=x) +x %= MOD +x *= power3[: N + M] * power2_inv[: N + M] % MOD +x %= MOD +coef = fact[N - 1 : N + M] * fact_inv[: M + 1] % MOD * fact_inv[N - 1] % MOD +coef *= power3[K : K + M + 1][::-1] +coef %= MOD +answer = (coef * x[N - 1 : N + M] % MOD).sum() % MOD