Problem:
 Score: 200 points    Problem Statement  There are three positive integers A , B and C written on a blackboard. E869120 performs the following operation K times:   Choose one integer written on the blackboard and let the chosen integer be n . Replace the chosen integer with 2n .   What is the largest possible sum of the integers written on the blackboard after K operations?      Constraints   A, B and C are integers between 1 and 50 (inclusive).  K is an integer between 1 and 10 (inclusive).         Input  Input is given from Standard Input in the following format:  A  B  C  K       Output  Print the largest possible sum of the integers written on the blackboard after K operations by E869220.        Sample Input 1 5 3 11
1      Sample Output 1 30  In this sample, 5, 3, 11 are initially written on the blackboard, and E869120 can perform the operation once. There are three choices:   Double 5 : The integers written on the board after the operation are 10, 3, 11 .  Double 3 : The integers written on the board after the operation are 5, 6, 11 .  Double 11 : The integers written on the board after the operation are 5, 3, 22 .   If he chooses 3., the sum of the integers written on the board afterwards is 5 + 3 + 22 = 30 , which is the largest among 1. through 3.       Sample Input 2 3 3 4
2      Sample Output 2 22  E869120 can perform the operation twice. The sum of the integers eventually written on the blackboard is maximized as follows:   First, double 4 . The integers written on the board are now 3, 3, 8 .  Next, double 8 . The integers written on the board are now 3, 3, 16 .   Then, the sum of the integers eventually written on the blackboard is 3 + 3 + 16 = 22 .

Solution (Python):
a=[int(i) for i in input().split()]
b=int(input())
print(sum(a)-max(a)+max(a)*2**b)

Solution (Python):

nums = tuple(map(int, input().split()))
print(max(nums)*(2**int(input()))+sum(nums)-max(nums))

Solution (Python):



def solve():
    bb = list(map(int, input().split()))
    K = int(input())

    print(sum(bb) + max(bb) * (2 ** K - 1))


if __name__ == '__main__':
    solve()

Solution (Python):
l = list(map(int,input().split()))
k = int(input())

res = max(l) * (2**k) + sum(l) - max(l)
print(res)

Solution (Python):
nums = list(map(int,input().split()))
k=int(input())
a = max(nums)*(2**k)
print(sum(nums) + max(nums)*(2**k)-max(nums))

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())

from itertools import product

l = []

for t in product(range(3),repeat=k):
    bd = [a,b,c]
    for i in range(k):
        bd[t[i]]*=2
    l.append(sum(bd))
print(max(l))

Solution (Python):
a,b,c=map(int,input().split())
z=int(input())

A=[a,b,c]
A=sorted(A)
print(A[0]+A[1]+A[2]*2**z)

Solution (Python):
def main():
    a,b,c = map(int, input().split())
    k = int(input())

    print(a+b+c + max(a,b,c)*(2**k - 1))

if __name__ == "__main__":
    main()

Solution (Python):
abc = [int(_) for _ in input().split()]
K = int(input())
print(max(abc) * 2 ** K + sum(abc) - max(abc))

Solution (Python):
a=list(map(int,input().split()))
k=int(input())

a.sort()
print(a[0]+a[1]+a[2]*2**k)

Solution (Python):
A, B, C = [int(_) for _ in input().split()]
K = int(input())

a, b, c = sorted([A, B, C])

result = a + b + c * (2**K)

print(result)

Solution (Python):
ABC = list(map(int, input().split()))
K = int(input())

ABC.sort()

print(ABC[0]+ABC[1]+ABC[2]*2**K)

Solution (Python):
a = list(map(int, input().split()))
k = int(input())

ma = max(a)
a.sort()

for i in range(k):
    ma *= 2

print(a[0] + a[1] + ma)

Solution (Python):
a,b,c = list(map(int, input().split()))
k = int(input())
m = max(a,b,c)
l = m
for i in range(k):
    l *= 2
print(sum([a,b,c])-m+l)

Solution (Python):
a = list(map(int,input().split()))
k = int(input())
a.sort();print(a[-1]*2**k+a[0]+a[1])

Solution (Python):
a = list(map(int,input().split()))
k = int(input())
b = a.pop(a.index(max(a)))

print(b*(2**k) + sum(a))

Solution (Python):
a, b, c = map(int,input().split())
k = int(input())
print(a + b + c +(max(a, b, c)*((2**k) - 1)))

Solution (Python):
a,b,c=(int(i) for i in input().split(' '))
k=int(input())
d=max(a,b,c)
print(d*(2**k)-d+a+b+c)

Solution (Python):
abc = list(map(int, input().split()))
k = int(input())
abc.sort()
abc[-1] *= 2**k
print(sum(abc))

Solution (Python):
a,b,c = sorted(map(int,input().split()))
print(c*2**int(input())+a+b)

Solution (Python):
L = sorted(list(map(int,input().split())))
k = int(input())
L[-1] = 2**k*L[-1]
print(sum(L))

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
mx = max(A,B,C)
ans = mx* 2**K
other = A+B+C - mx
print(ans + other)

Solution (Python):
word = list(map(int, input().split()))
k = int(input())

word.sort()
word[2] = word[2] * (2 ** k)

print(sum(word))

Solution (Python):
L = sorted(list(map(int,input().split())))
K = int(input())
L[2] = L[2]*(2**K)
print(sum(L))

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())
A,B,C=sorted([A,B,C],reverse=True)

for i in range(K):
    A=A*2

print(A+B+C)

Solution (Python):
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

a = list(li())
k = ni()
a.sort()

for i in range(k):
    a[2] *= 2
    a.sort()
    
print(sum(a))

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
print( a+b+c + (2**k)*max( [a,b,c] ) - max( [a,b,c] ))

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
l = [A,B,C]
l.sort()
t = l[-1]
for i in range(K):
    t *= 2
print(l[0]+l[1]+t)

Solution (Python):
A = map(int, raw_input().split())
K = input()
A = sorted(A)
for i in range(K):
	A[-1] *= 2
print sum(A)

Solution (Python):
N = [int(i) for i in input().split()]
K = int(input())
N = sorted(N)
print(N[2]*(2**K)+N[0]+N[1])

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())

t = max(a, b, c)

u = t * (2 ** k)

if t == a:
    print(u + b + c)
elif t == b:
    print(u + a + c)
elif t == c:
    print(u + a + b)

Solution (Python):
def run(A, B, C, K):
    if A > B:
        if A > C:
            ret = A*(2**K) + B + C
        else:
            if B > C:
                ret = B*(2**K) + A + C
            else:
                ret = C*(2**K) + A + B
    else:
        if B > C:
            ret = B*(2**K) + A + C
        else:
            ret = C*(2**K) + A + B
    return ret


def main():
    A, B, C = map(int, input().split())
    K = int(input())
    print(run(A, B, C, K))


if __name__ == '__main__':
    main()

Solution (Python):
x = list(map(int, input().split()))
K = int(input())
x.sort()
print(x[0] + x[1] + 2 ** K * x[2])

Solution (Python):
abc = list(map(int, input().split()))
k = int(input())
abc.sort()
abc[-1] = abc[-1]*2**k
print(sum(abc))

Solution (Python):
a=list(map(int,input().split()))
k=int(input())
a.sort()
print(a[0]+a[1]+a[2]*(2**(k)))

Solution (Python):
l=list(map(int,input().split()))
n=int(input())
print(sum(l)+max(l)*((2**n)-1))

Solution (Python):
a, b, c = list(map(int , input().split()))
k = int(input())

if a == max(a, b, c):
    ans = a*2**k + b + c
elif b == max(a, b, c):
    ans = a + b*2**k + c
else:
    ans = a + b + c*2**k
print(ans)

Solution (Python):


n = list(map(int, input().split()))
k = int(input())
n.sort()
num = n[2]
for i in range(0,k):
  num = num * 2

print(num+n[0]+n[1])

Solution (Python):
D = [int(i) for i in input().split()]
K = int(input())

for i in range(K):
    A, B, C = sorted(D)
    D = [A, B, C*2]
print(sum(D))

Solution (Python):
a = list(map(int,input().split()))
k = int(input())
a.sort(reverse = True)
a[0] = a[0]*2**k
print(sum(a))

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())

print((2**k-1)*max(a,b,c)+a+b+c)

Solution (Python):
ABC = sorted(map(int, input().split()))
K = int(input())
print(ABC[0]+ABC[1]+(2**K)*ABC[2])

Solution (Python):
nl = sorted(list(map(int, input().split())), reverse=True)
n = int(input())
for i in range(n):
  nl[0] *= 2
print(sum(nl))

Solution (Python):
l=[int(i) for i in input().split()]
k=int(input())
ans=chk=0
for i in range(3):
    tmp=l[i]
    for j in range(k):
       tmp*=2
    ans=max(ans,sum(l)+tmp-l[i])
print(ans)

Solution (Python):
abc = [int(m) for m in input().split(" ")]
k = int(input())

print(max(abc)*2**k + sum(abc) - max(abc))

Solution (Python):
ABC = [int(_) for _ in input().split()]
K = int(input())

ABC.sort()
ABC[-1] = max(ABC)*2**K
print(sum(ABC))

Solution (Python):
arr = list(map(int, input().split()))
k = int(input())
arr.sort()
print(arr[0] + arr[1] + arr[2]*(2**k))

Solution (Python):
ABC = list(map(int, input().split()))
K = int(input())

ABC2 = sorted(ABC)

M = max(ABC)
for i in range(K):
    M = M * 2

print(M + ABC2[0] + ABC2[1])

Solution (Python):
a, b, c = map(int, input().split())

k = int(input())

n = []
n.append(a)
n.append(b)
n.append(c)

n.sort()

for i in range(k):
    n[2] *= 2


print(sum(n))

Solution (Python):
a=input().split()
k=int(input())
a=list(map(int,list(a)))
a.sort()
for i in range(k):
    a[2]=a[2]*2
print(sum(a))

Solution (Python):
a = list(map(int,input().split()))
a.sort()
a[2] = a[2] * 2**int(input())
print(sum(a))

Solution (Python):
a = list(map(int,input().split()))
for i in range(int(input())):
  a.sort()
  a[2] = 2*a[2]
print(sum(a))

Solution (Python):
a,b,c = map(int, input().split())
k = int(input())
d = max(a,b,c)
for i in range(0,k):
    d *= 2

print(d + a+b+c - max(a,b,c))

Solution (Python):
a,b,c = map(int, input().split())
k = int(input())
list_abc = list((a,b,c))
list_abc.sort()
while k > 0:
    list_abc[-1] *= 2
    k -= 1
ans = 0
for number in list_abc:
    ans += number
print(ans)

Solution (Python):
n = list(map(int,input().split()))
k = int(input())

for i in range(k):
    a = max(n)
    n.remove(a)
    n.append(a*2)
print(sum(n))

Solution (Python):
A=list(map(int,input().split()))
k=int(input())

m=max(A)

print(m*2**k+sum(A)-m)

Solution (Python):
a = list(map(int,input().split()))
k = int(input())
print(a[0]+a[1]+a[2]+(max(a)*(2**k-1)))

Solution (Python):
A,B,C=list(map(int,input().split(' ')))
K=int(input())

print(A+B+C+(2**K-1)*max(A,B,C))

Solution (Python):
a, b, c = [int(v) for v in input().split()]
k = int(input())

values = sorted([a, b, c])
maxv = values[-1]
maxv = maxv * (2 ** k)
print(sum(values[:2], maxv))

Solution (Python):
li = sorted(list(map(int, input().split())))
k = int(input())

li[-1] = li[-1] * 2 ** k

print(sum(li))

Solution (Python):
value = []
for part in input().split():
    value.append(int(part))

value.sort()
value.reverse()

k = int(input())
value[0] = value[0] * (2 ** k)

print(sum(value))

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
a.sort()
a[-1] *= 2 ** k
print(sum(a))

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
m=max(a,b,c)
print(a+b+c-m+m*2**k)

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())
m = a+b+c+max(a,b,c)*(2**k - 1)
print(m)

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
L = [A,B,C]
L.sort()
print(L[0]+L[1]+(L[2])*(2**K))

Solution (Python):
three_int = list(map(int, input().split()))
k = int(input())

for _ in range(k):
    three_int = sorted(three_int, reverse=True)
    
    three_int[0] = three_int[0] * 2
print(sum(three_int))

Solution (Python):
a, b, c = map(int, raw_input().split())
k = int(raw_input())
max_value = max([a,b,c])
value = max_value
for i in range(k):
    value = value * 2
print(sum([a,b,c]) - max_value + value)

Solution (Python):
A, B, C = list(map(int, input().split()))
K = int(input())

for _ in range(K):
    maxN = max(A, B, C)
    if maxN == A:
        A *= 2
    elif maxN == B:
        B *= 2
    else:
        C *= 2

print(A + B + C)

Solution (Python):
a = input().split()
a = [int(s) for s in a]
k = int(input())
maxi = int(max(a))
ans = 0 - maxi
for i in range(k):
    maxi = maxi * 2
for i in a:
    ans = ans + int(i)
print(str(maxi+ans))

Solution (Python):
a=sorted(list(map(int,input().split())))
print(sum(a)+a[2]*(2**int(input())-1))

Solution (Python):
A=sorted(list(map(int,input().split())))
A[2]*=2**int(input())
print(sum(A))

Solution (Python):
A=sorted(list(map(int,input().split())))
for _ in range(int(input())):
    A[2]*=2
print(sum(A))

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())

val = max([A, B, C])

for i in range(K):
    val *= 2

print(val + sum([A, B, C]) - max([A, B, C]))

Solution (Python):
list1=list(map(int, input().split()))
k = int(input())
list1.sort()
a,b,c=list1[0],list1[1],list1[2]
d=c*(2**k)
print(a+b+d)

Solution (Python):
nums = [int(i) for i in input().split()]
K = int(input())

print(max(nums)*(2**K-1) + sum(nums))

Solution (Python):
a,b,c=map(int,input().split( ))
k=int(input())
d=[a,b,c]
print(a+b+c+max(d)*2**k-max(d))

Solution (Python):
a=list(map(int,input().split()))
k=int(input())
print(sum(a)+max(a)*2**k-max(a))

Solution (Python):
print((lambda a:sum(a)+max(a)*(2**int(input())-1))(list(map(int,input().split()))))

Solution (Python):
ABC = list(map(int,input().split()))
K = int(input())
print(max(ABC)*(2**K)+sum(ABC)-max(ABC))

Solution (Python):
a = list(map(int, input().split()))
n = int(input())
for i in range(n):
    temp = max(a)
    index = a.index(temp)
    a[index] = 2*temp
ans = sum(a)
print(ans)

Solution (Python):
inpt = map(int, raw_input().split())
inpt.sort()
K = int(raw_input())

for i in range(0, K):
	inpt[2] = inpt[2] * 2

print inpt[0] + inpt[1] + inpt[2]

Solution (Python):
L = [int(i) for i in input().split()]
K = int(input())

M = max(L)
L.remove(M)

ans = M*(2**K) + sum(L)
print(ans)

Solution (Python):
lst = list(map(int,input().split(" ")))
K = int(input())
for i in range(K):
    c = max(lst)
    lst[lst.index(max(lst))] = c*2
print(sum(lst))

Solution (Python):
A, B, C = map(int, input().split())
K       = int(input())

if A >= B and A >= C:
    print(A * 2 ** K + B + C)
elif B >= A and B >= C:
    print(A + B * 2 ** K + C)
else:
    print(A + B + C * 2 ** K)

Solution (Python):
A,B,C= map(int,input().split())
K=int(input())
print(max(A,B,C)*2**K+A+B+C-max(A,B,C))

Solution (Python):

a=list(map(int,input().split()))
a.sort()
k=int(input())
for i in range(k):
    a[2]=a[2]*2
print(a[0]+a[1]+a[2])

Solution (Python):


l = list(map(int, input().split()))  
k = int(input())

l.sort()

for i in range(k):
    l[2] *= 2

print(sum(l))

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
print(A+B+C+max(A,B,C)*2**K-max(A,B,C))

Solution (Python):
abc = list(map(int, input().split()))
k = int(input())
print(max(abc) * (2 ** k - 1) + sum(abc))

Solution (Python):
a = list(map(int, input().split()))
a.sort()
K = int(input())
 
print(a[2]*(2**K) + a[1] + a[0])

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
for i in range(k):
  if a >= b and a >= c:
    a *= 2
  elif b >= a and b >= c:
    b *= 2
  else:
    c *= 2
print(sum([a, b, c]))

Solution (Python):
A = list(map(int, input().split()))
K = int(input())
A.sort()
print(A[0] + A[1] + A[2] * 2 ** K)

Solution (Python):
arr = list(map(int, input().split()))
k = int(input())

print(max(arr) * (2 ** k - 1) + sum(arr))

Solution (Python):
ABC = list(map(int, input().split()))
K = int(input())
ABC.sort()
print(ABC[0]+ABC[1]+ABC[2]*2**K)

Solution (Python):


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

def main():
    A, B, C = map(int, input().split())
    K = int(input())

    m = max(A, B, C)
    d = m
    for i in range(K):
        d *= 2
    print(A + B + C - m + d)

if __name__ == '__main__':
    main()

Solution (Python):
A,B,C = map(int, input().split())
K = int(input())

max_int = max(A,B,C)

print(A+B+C - max_int + max_int*(2**K))

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
a.sort()
for i in range(k):
    a[2] = a[2]*2
print(sum(a))

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
print(a + b + c + max(a, b, c)*(2**k) - max(a, b, c) )

Solution (Python):
a= list(map(int, input().split()))
K = int(input())
a.sort()
print(a[2] * (2 ** K ) + a[1] + a[0])

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(10000)


def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))


def to_bin(x):
    return bin(x)[2:]



dp = None

def main():
    A = list(map(int, input().split()))
    K = int(input())

    for i in range(K):
        A[A.index(max(A))] *= 2

    print(sum(A))

main()

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
mx = max(A,B,C)
ans = A+B+C - mx + mx * 2**K
print(ans)

Solution (Python):
A,B,C = map(int, input().split())
K = int(input())

max_abc = max(A,B,C)
rem = A+B+C - max_abc
for i in range(K):
    max_abc *= 2

print(rem+max_abc)

Solution (Python):
a=list(map(int,input().split()))
print(sum(a)+max(a)*(2**int(input())-1))

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
print(a + b + c - max(a, b, c) + max(a, b, c) * 2 ** k)

Solution (Python):
A, B, C = [int(x) for x in input().split()]
K = int(input())

def main():
    list = [A, B, C]
    list.sort(reverse=True)
    list[0] *= 2 ** K
    print(sum(list))

if __name__ == "__main__":
    main()

Solution (Python):
A, B, C = [int(x) for x in input().split()]
K = int(input())

def main():
    list = [A, B, C]
    list.sort(reverse=True)
    for _ in range(K):
        list[0] *= 2
    print(sum(list))

if __name__ == "__main__":
    main()

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
X = max(A,B,C)
print(A+B+C+-X +X*(2)**K )

Solution (Python):
l=list(map(int,input().split()))
print((sum(l)-max(l))+max(l)*2**int(input()))

Solution (Python):
ABC = list(map(int,input().split()))
K = int(input())
print(max(ABC) * 2**K + sum(ABC) - max(ABC))

Solution (Python):
abc = [int(m) for m in input().split(" ")]
k = int(input())

print(max(abc)*2**k + sum(abc) - max(abc))

Solution (Python):
l=list(map(int,input().split()))
k=int(input())
m=max(l)
l.pop(l.index(m))
print(sum(l)+m*(2**k))

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
d = max(a)
print(d*2**k + sum(a) - d)

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())

List = [A, B, C]
sort_list = sorted(List)

sort_list[2] = sort_list[2] * (2**K)

SUM = sum(sort_list)


print(SUM)

Solution (Python):
a= list(map(int,input().split()))
k = int(input())
max = max(a)
del a[a.index(max)]
for i in range(k):
    max *= 2
print(sum(a) + max)

Solution (Python):

n=[int(i) for i in input().split()]
a=int(input())
n.sort()
n[0]=n[0]+n[1]+n[2]*2**a
print(n[0])

Solution (Python):
suuti = list(map(int,input().split()))

K = int(input())
i =1
while i<=K:
    i +=1
    a = suuti.index(max(suuti))
    suuti[a]= 2*max(suuti)

print(sum(suuti))

Solution (Python):
a=list(map(int,input().split()))
k=int(input())
for i in range(3):
    if a[i]==max(a):
        a[i]*=2**k;break
print(sum(a))

Solution (Python):
a=input().split()
b=int(input())
c=[int(i) for i in a]
d=0
for j in c:
  d+=j
d=d-max(c)
d=d+(max(c))*(2**b)
print(d)

Solution (Python):
A,B,C=map(int,input().split())
N=int(input())
if A<B:
    A,B = B,A
if A<C:
    A,C = C,A
print(A*(2**N)+B+C)

Solution (Python):
L = [0, 0, 0]
L[0], L[1], L[2] = map(int, input().split())
L.sort()
K = int(input())
print(L[0]+L[1]+L[2]*(2**K))

Solution (Python):
a, b, c = map(int,input().split())
k = int(input())
sumn = a+b+c
maxn = max(a,b,c)
sumn -= maxn

for i in range(k):
	maxn *= 2

print(sumn+maxn)

Solution (Python):
a, b, c = sorted(list(map(int, input().split())))
k = int(input())
print(a+b+c*(2**k))

Solution (Python):


def main():
    blackboard_list = list(map(int, input().split()))
    K = int(input())

    blackboard_list[blackboard_list.index(max(blackboard_list))] = max(blackboard_list) * 2 ** K
    print(sum(blackboard_list))

if __name__ == '__main__':
    main()

Solution (Python):
num_list=list(map(int,input().split()))
K=int(input())
num_list.sort()
n_sum=num_list[0]+num_list[1]+num_list[2]*2**K
print(n_sum)

Solution (Python):
l = [int(i) for i in input().split()]
k = int(input())

c = k
while c > 0:
    l.sort(reverse=True)
    l[0] = l[0]*2
    c = c-1

print(l[0]+l[1]+l[2])

Solution (Python):
A, B, C = map( int, input().split() )
K = int(input())
print(A + B + C - max(A,B,C) + max(A,B,C)*(2**K))

Solution (Python):

li = list(map(int,input().split()))	
k=int(input())

for j in range(0,k):
	li[li.index(max(li))] = li[li.index(max(li))]*2

print(sum(li))

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
abc = [A, B, C]
for _ in range(K):
	abc = sorted(abc)
	abc[2] *= 2
print(sum(abc))

Solution (Python):
a,b,c = map( int, input().split())
k = int(input())

for x in range(k):
    largest = max(a,b,c)
    if largest == a:
        a = 2*a
    elif largest == b:
        b = 2*b
    elif largest == c:
        c = 2*c
print(a+b+c)

Solution (Python):
A, B, C = input().split()
K = int(input())

A = int(A)
B = int(B)
C = int(C)

X = (A, B, C)
M = max(X)
print(M * (2 ** K) + A + B + C -M)

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())

print(max(A,B,C)*(2**K)+A+B+C-max(A,B,C))

Solution (Python):
x=input().split()
y=0
while y<len(x):
    x[y]=int(x[y])
    y+=1
x.sort()
k=int(input())

ans=(2**k)*x[-1]+x[0]+x[1]
print(ans)

Solution (Python):
"""
https://abc096.contest.atcoder.jp/tasks/abc096_b
"""
[a,b,c]=[int(i) for i in input().split()]
k=int(input())
d=max(a,b,c)*(2**k)
if max(a,b,c)==a:
    print(b+c+d)
elif max(a,b,c)==b:
    print(a+c+d)
else:
    print(a+b+d)

Solution (Python):
integers=list(map(int, input().split()))
K=int(input())
integers.sort()
for i in range(K):
    integers[2] = integers[2]*2
print(sum(integers))

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())

print(a+b+c+(2**k-1)*max(a,b,c))

Solution (Python):
a,b,c=map(int,input().split())
K = int(input())
print(max(a,b,c)*(2**K)+(a+b+c)-max(a,b,c))

Solution (Python):
a, b, c = map(int, input().split())
X = {'A':a, 'B':b, 'C':c}
K = int(input())
for i in range(K):
    max_k = max(X, key=X.get)
    X[max_k] *= 2
print(sum(X.values()))

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
ans = a+b+c+max(a, b, c)*2**k-max(a, b, c)
print(ans)

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
d=max(a,b,c)
print(a+b+c+d*(2**k-1))

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())

if A >= B and A >= C:
    print(A*(2**K) + B + C)
elif B >=C:
    print(A + B*(2**K) + C)
else:
    print(A + B + C*(2**K))

Solution (Python):
A, B, C = map(int,input().split(" "))
K = int(input())
for k in range(K):
    m = max(A,B,C)
    if A == m:
        A *= 2
    elif B == m:
        B *= 2
    else:
        C *= 2
print(A+B+C)

Solution (Python):
a = input().split()
a2 = []
for _ in a:
    a2.append(int(_))
k = int(input())
for i in range(k):
    target = a2.index(max(a2))
    a2[target] *= 2
print(sum(a2))

Solution (Python):
if __name__ == '__main__':
    nums = list(map(int, input().split(' ')))
    N = int(input())

    maxNumIndex = nums.index(max(nums))
    nums[maxNumIndex] *= 2**N

    print(sum(nums))

Solution (Python):

def main():
    ns = [int(i) for i in input().split()]
    k = int(input().strip())

    for i in range(k):
        x = max(ns)
        ns[ns.index(x)] = x * 2

    print(sum(ns))

if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np

a = list(map(int, input().split()))
k = int(input())
for i in range(0, k):
    max_sub = np.argmax(a)
    a[max_sub] = a[max_sub] * 2
print(sum(a))

Solution (Python):
a, b, c = [int(i) for i in input().split()]
k = int(input())

l = sorted([a, b, c])
print(l[-1] * (2 ** k) + l[0] + l[1])

Solution (Python):
nums = list(map(int, input().split()))
N = int(input())
nums.sort()
print(nums[0] + nums[1] + nums[2] * (2 ** N))

Solution (Python):
ns = [int(s) for s in input().split()]
k = int(input())

nn = pow(2, k)
ans = sum(ns) - max(ns) + max(ns) * nn
print(ans)

Solution (Python):
a,b,c = [int(i) for i in input().split()]
K = int(input())

max = max(a,b,c)
ans = a+b+c + max*(2**K) - max


print(ans)

Solution (Python):
a,b,c = map(int, input().split())
K = int(input())

list = [a,b,c]

max = max(a,b,c)

sum = a+b+c
sum += max * (2**K - 1)

print (sum)

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
a = max(A, B, C)
b = min(A, B, C)
c = A + B + C - a - b
for i in range(K):
  a *= 2
print(a + b + c)

Solution (Python):
goop=input().split()
k=int(input())
a=int(goop[0])
b=int(goop[1])
c=int(goop[2])
king=max(a,b,c)
print(king*2**k+a+b+c-king)

Solution (Python):

N = [int(i) for i in input().split()]
K = int(input())
for k in range(K):
    m = max(N)
    i = N.index(m) 
    N[i] = 2*m
print(sum(N))

Solution (Python):
L = sorted(map(int,input().split()),reverse=True)
K = int(input())
L[0] *= 2 ** K
print(sum(L))

Solution (Python):
a,b,c=sorted(map(int,input().split()))
print(a+b+c*2**int(input()))

Solution (Python):
a,b,c = input().split()
A = int(a)
B = int(b)
C = int(c)
K = int(input())

for i in range(K):
	if(max(A,B,C)==A):
		A = A*2
	elif(max(A,B,C)==B):
		B = B*2
	elif(max(A,B,C)==C):
		C = C*2

sum_abc = A + B + C
print(sum_abc)

Solution (Python):
A,B,C=map(int, input().split())
K=int(input())
D=A+B+C
ans=max(A,B,C)
E=D-ans
F=ans*2**K
print(E+F)

Solution (Python):
a=list(map(int,input().split()))
b=sorted(a,reverse=True)
K=int(input())
print(b[0]*2**K+b[1]+b[2])

Solution (Python):
num = list(map(int,input().split()))
k = int(input())

num.sort()

for i in range(k):
	num[2] *= 2
	
print(num[0]+num[1]+num[2])

Solution (Python):
line = list(map(int,input().split()))
n=int(input())
line.sort()
line[2]=line[2]*(2**n)
print(sum(line))

Solution (Python):
v = list(map(int, input().split()))
v.sort(reverse=True)
v[0] = v[0] * 2**int(input())
print(sum(v))

Solution (Python):
a,b,c = map(int, input().split())
k = int(input())
kk=2**k
m = max(a,b,c)
al = a+b+c-m+m*kk
print(al)

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
kk=2**k
sum=0
if a>=b and a>=c:
  sum=b+c+kk*a
elif b>=c:
  sum=a+c+kk*b
else:
  sum=a+b+kk*c
print(sum)

Solution (Python):


def maximumSum(slist):

    ABCli = list(map(int,slist[0]))
    K = int(slist[1][0])
    ABCli.sort()

    for i in range(0,K):
        ABCli[2] = ABCli[2] * 2

    return sum(ABCli)


if __name__ == '__main__':
    
    string_list = [input().split() for i in range(2)]

    print(maximumSum(string_list))

Solution (Python):
x,y,z=[int(x) for x in str(input()).split()]
k=int(input())

a=max(x,y,z)
print(x+y+z-a+2**k*a)

Solution (Python):
list = list(map(int, input().split()))
N = int(input())
list.sort()
for i in range(N):
    list = [list[0], list[1], list[2]*2]
print(sum(list))

Solution (Python):
l = list(map(int, input().split()))
A, B, C = [i for i in l]
K = int(input())

max_num = max(A, B, C)
l.remove(max_num)

for i in range(K):
    max_num *= 2

ans_num = l[0] + l[1] + max_num
print(ans_num)

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())

d = max(a, b, c)
e = a + b + c - d
d *= 2 ** k
print(d + e)

Solution (Python):
a, b, c = map(int, raw_input().split())
k = input()
mx = max(a, b, c)
if a == mx:
	print a *(2 ** k) + b + c
elif b == mx:
	print b *(2 ** k) + a + c
else :
	print c *(2 ** k) + a + b

Solution (Python):
a, b, c = sorted(map(int, input().split()))
k = int(input())
print(a+b+(c*(2**k)))

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
li = [a, b, c]
ol = sorted(li)
for i in range(k):
    ol[2] *= 2
print(sum(ol))

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
m_sum = A + B + C
a = max(A, B, C)
b = min(A, B, C)
c = m_sum - a - b
for i in range(K):
	m_sum += max(a, b, c)
	a *= 2
print(m_sum)

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
M = max(A, B, C)
if M == A:
    print(M*(2**K) + B + C)
elif M == B:
    print(A + M*(2**K) + C)
else:
    print(A + B + M*(2**K))

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
if(A >= B and A >= C):
    print(A*pow(2,K)+B+C)
elif(B >= A and B >= C):
    print(A+B*pow(2,K)+C)
else:
    print(A+B+C*pow(2,K))

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())
if max(a,b,c) == a:
  print(a*(2**k)+b+c)
elif max(a,b,c) == b:
  print(b*(2**k)+a+c)
else:
  print(a+b+c*(2**k))

Solution (Python):
A,B,C=sorted(map(int,input().split()))
print(C*2**int(input())+B+A)

Solution (Python):
A,B,C = [int(i) for i in input().split()]
K = int(input())

integerList = [A,B,C]
arrayNum =  integerList.index(max(integerList))
integerList[arrayNum] = 2**K * integerList[arrayNum]
print(sum(integerList))

Solution (Python):
A,B,C = map(int, input().split())
K = int(input())

l = [A, B, C]
l.sort()
print( l[2]*(2**K) + l[1] + l[0] )

Solution (Python):
ABC = list(map(int, input().split()))
K = int(input())

max_abc = max(ABC)
print(sum(ABC) - max_abc + max_abc * 2 ** K)

Solution (Python):
a,b,c = map(int,input().split())

K = int(input())

numlist = [a,b,c]
numlist.sort()

print(numlist[2]*2**K + numlist[1] + numlist[0])

Solution (Python):
l = list(map(int,input().split()))
k = int(input())
l.sort()
for i in range(k):
    l[2] = l[2]*2
print('{}'.format(sum(l)))

Solution (Python):
arr = list(map(int, input().split()))
k = int(input())

maxn = max(arr)
removed_arr = arr.remove(maxn)
calcn = maxn * pow(2, k)
arr.append(calcn)

print(sum(arr))

Solution (Python):
l = map(int, raw_input().split())
k = input()

x = max(l)
y = sum(l) - x

print x * (2 ** k) + y

Solution (Python):
a = list( map( int, input().split() ) )
a.sort( reverse = True )
limit = int( input() )

for num in range( limit ) :
    a[0] = a[0] * 2

print( a[0] + a[1] + a[2] )

Solution (Python):
l = list(map(int, input().split()))
k = int(input())
print(sum(l) + max(l)*((1<<k)-1))

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())

D = min(A, B, C)
E = min(max(A, B), max(B, C), max(A, C))
F = max(A, B, C)

print(D + E + F * (2**K))

Solution (Python):
blackboard = list(map(int, input().split( )))
K = int(input())
for i in range(K):
    blackboard.sort(reverse = True)
    blackboard[0] = blackboard[0]*2
print(sum(blackboard))

Solution (Python):
A,B,C = map(int,input().split())
K=int(input())
D = max(A,B,C)
E = D*(2**K)
print(A+B+C-D+E)

Solution (Python):
numlist = list(map(int, input().split()))
k = int(input())

numlist.sort()
numlist[len(numlist) - 1]  *= 2 ** k
print(sum(numlist))

Solution (Python):
A = list(map(int,input().split()))
K = int(input())

while K>0:
  A.sort()
  a = A.pop(-1) *2
  A.append(a)
  K-=1

print(sum(A))

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
ans = a+b+c
m = -100
if m < a: 
    m = a
if m < b: 
    m = b
if m < c: 
    m = c
ans = ans - m
for i in range(k):
    m = m*2
print(ans + m)

Solution (Python):
A,B,C=map(int,input().split(' '))
K=int(input())

s=A+B+C
m=max(A,B,C)
s-=m
s+=m*2**K

print(s)

Solution (Python):
l = list(map(int, input().split()))
K = int(input())

l.sort()
for i in range(K):
    l[2] = 2*l[2]
    
print(l[0] + l[1] + l[2])