a, b, c = map(int, input().split())
n = int(input())
m = max(a, b, c)


def bai(x):
    return 2 * x


for i in range(n):
    m = bai(m)
print(m - max(a, b, c) + a + b + c)

6268ebc12f7921931c6cbbd7291098bba58181f9
<mask token>

<mask token>


def bai(x):
    return 2 * x


<mask token>

<mask token>


def bai(x):
    return 2 * x


for i in range(n):
    m = bai(m)
print(m - max(a, b, c) + a + b + c)

a, b, c = map(int, input().split())
n = int(input())
m = max(a, b, c)


def bai(x):
    return 2 * x


for i in range(n):
    m = bai(m)
print(m - max(a, b, c) + a + b + c)
