#!/usr/bin/env python3 # † M = 10**9 + 7 ### if __name__ == '__main__': a, b = map(int, input().split()) n, k = map(int, input().split()) N = n+5 fac = [None] * N fac[0] = 1 for i in range(N-1): fac[i+1] = fac[i] * (i+1) % M inv = [None] * N inv[N-1] = pow(fac[N-1], M-2, M) for i in reversed(range(N-1)): inv[i] = inv[i+1] * (i+1) % M def comb(n, k): return fac[n] * inv[n-k] * inv[k] % M def solve1(n, k): n -= 1 k -= 1 x = comb(n, k) y = comb(n, k-1) res = a * x + b * y res %= M return res def solve2(n): n -= 1 L = [comb(n, i) for i in range(n+1)] xs = L + [0] ys = [0] + L res = 0 for x, y in zip(xs, ys): res += a*a*x*x res += b*b*y*y res += a*b*x*y*2 res %= M return res print(solve1(n, k)) print(solve2(n))