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):

import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi

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

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

m = max(a, b, c)
s = sum([a, b, c])-m
for i in range(k):
    m *= 2

print(s+m)

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

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

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

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

Solution (Python):
num = list(map(int, input().split()))
k = int(input())
k = 2**k
tmp = sorted(num)

print(tmp[0]+tmp[1]+tmp[2]*k)

Solution (Python):
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)

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7


a,b,c=MI()
k=I()
ans=a+b+c+max(a,b,c)*(2**k-1)
print(ans)

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

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

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

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

print(ans)

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

A[-1] *= 2**k

print(sum(A))

Solution (Python):
l = list(map(int,input().split()))
k=int(input())
n_l = sorted(l,reverse=True)

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

print(sum(n_l))

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
lis=[]
for i in range(0,k+1):
  for j in range(0,k-i+1):
      atai=a*(2**i)+b*(2**j)+c*(2**(k-i-j))
      if not atai in lis:
        lis.append(atai)
lis.sort()
print(lis[-1])

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

for i in range(1,k+1):
       f=a[2]*2
       a[2]=f
       
c=a[0]+a[1]+a[2]
print(c)

Solution (Python):
def f(a, b, c, k):
    abc = sorted([a, b, c])
    if k != 0:
        abc[2] *= 2 ** k
    print(sum(abc))

a, b, c = map(int, input().split())
k = int(input())
f(a, b, c, k)

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

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

print(ans)

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

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

print(ans)

Solution (Python):
l = list(map(int,input().split()))
n = int(input())
l.sort()
for i in range(n):
  l[2] = l[2] * 2
  
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):
board = list(map(int, input().split()))
k = int(input())
sort_board = sorted(board, reverse=True)
for _ in range(k):
    sort_board[0] *= 2
print(sum(sort_board))

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

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

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

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

d = max(a,b,c)

print(d*(2**k)+a+b+c-d)

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
    elif (c >= a and c >= b): c *= 2
print(a + b + c)

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):
def main():
    t = list(map(int, input().split()))
    n = input()
    for i in range(int(n)):
        ind = t.index(max(t))
        t[ind] = t[ind] * 2
    print(sum(t))

if __name__ == '__main__':
    main()

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

n = max(a, b)
n = max(n, c)

ans = a+b+c+n*(2**k-1)

print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

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

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

for _ in range(k):
    if a > b and a > c:
        a *= 2
    elif b > a and b > c:
        b *= 2
    else:
        c *= 2
print(a + b + c)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    A=list(map(int,input().split()))
    K=int(input())
    A.sort()
    print(A[-1]*2**K+sum(A[:2]))

if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

for i in range(K):
    l = sorted(l,reverse=True)
    l[0] = l[0] * 2
print(sum(l))

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

Solution (Python):
import bisect
li = sorted(map(int, input().split()))
k = int(input())
for i in range(k):
    tmp = li.pop()
    bisect.insort(li, tmp * 2)
print(sum(li))

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
L = [A,B,C]
maxL = max(L)
L.remove(maxL)
print(maxL*2**K + sum(L))

Solution (Python):
A=sorted(list(map(int,input().split())))
K=int(input())
print(A[2]*2**K+sum(A[: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):

import sys
try:
    from typing import List
except ImportError:
    pass


def solve(A: int, B: int, C: int, K: int):
    print(A + B + C + max(A, B, C) * (2 ** K - 1))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    C = int(next(tokens))  
    K = int(next(tokens))  
    solve(A, B, C, K)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    a, b, c = nm()
    k = ni()

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

    print(arr.pop()*2**k + sum(arr))


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
List = sorted([int(i) for i in input().split(" ")],reverse=True)
K = int(input())
List[0] = List[0]*(2**K)
print(sum(List))

Solution (Python):
A = [int(x) for x in input().split()]
k = int(input())

A.sort()

ans = sum(A[0:2]) + A[2] * 2 ** (k)
print(ans)

Solution (Python):

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

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())
print(max(A, B, C)*(2**K) + A + B + C - max(A, B, C))

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

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

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

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

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

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

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=map(int,input().split())
K=int(input())
summy=((2**K)*(max(A,B,C)))+A+B+C-max(A,B,C)
print(summy)

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
al = [a, b, c]
bl = [a, b, c]
cl = [a, b, c]

for i in range(k):
    al[0] = al[0] * 2
    bl[1] = bl[1] * 2
    cl[2] = cl[2] * 2

sm = [sum(al), sum(bl), sum(cl)]
print(max(sm))

Solution (Python):
def main():
    A, B, C = map(int, input().split())
    K = int(input())
    for i in range(K):
        if A >= B and A >= C:
            A = 2*A
        if B >= A and B >= C:
            B = 2*B
        if C >= A and C >= B:
            C = 2*C
    print(sum([A, B, C]))
main()

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 i in range(k):
    li.sort(reverse=True)
    li[0] = li[0] * 2

print(sum(li))

Solution (Python):

a = [int(s) for s in input().split()]
k = int(input())

a.sort()

print(sum(a) + a[2] * (2 ** k - 1))

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

biggest = ABC.index(max(ABC))
ans = sum(ABC) - ABC[biggest] + ABC[biggest] * 2 ** K

print(ans)

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

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

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

Solution (Python):
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    abc = MII()
    k = II()
    maxv = max(abc)
    sumv = sum(abc) - maxv
    for i in range(k):
        maxv *= 2
    sumv += maxv
    print(sumv)


if __name__ == '__main__':
    main()

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

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

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


X.sort(reverse=True)
for i in range(K):
    X[0] = X[0]*2

print(sum(X))

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

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 = 2 ** (int(input()))
print(A + B + C + max(A, B, C) * (X - 1))

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

K=int(input())
for i in range(K):
  abclist[2]*=2
  
print(sum(abclist))

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, b, c = map(int, input().split())
K = int(input())
max_a = max(a, b, c)
print(sum([a, b, c])-max_a+max_a*(2**K))

Solution (Python):
def resolve():
    A, B, C = list(map(int, input().split(" ")))
    K = int(input())
    m = max(A, B, C)
    mul = m * 2 ** K
    print(sum([A, B, C]) - m + mul)

if '__main__' == __name__:
    resolve()

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

a.sort()
b=a.pop()
b=b*2**k
a.append(b)
print(sum(a))

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

print(sum([a, b, c]) - max([a, b, c]) + max([a, b, c]) * (2**k))

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

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

tmp = max(a,b,c)
for i in range(k):
    tmp *= 2
    
ans = a + b + c + tmp - max(a,b,c)
print(ans)

Solution (Python):
L = [int(num) for num in input().split()]
K = int(input())
L.sort()
L[-1] = L[-1] * (2**K)
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):
*a,=map(int,input().split());m=max(a);print(sum(a)+m*2**int(input())-m)

Solution (Python):
line = input()
a, b, c = [int(n) for n in line.split()]
k = int(input())
numbers = [a, b, c]
numbers.sort(reverse=True)
numbers[0] *= 2 ** k
print(sum(numbers))

Solution (Python):
line = input()
a, b, c = [int(n) for n in line.split()]
k = int(input())
numbers = [a, b, c]
numbers.sort()
numbers[-1] *= 2 ** k
print(sum(numbers))

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

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

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

Solution (Python):
a, b, c = map(int, input().split())
d = int(input())
l = [a, b, c]
for _ in range (d):
    index = l.index(max(l))
    l[index] = l[index] * 2
print(sum(l))

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

while k>0:
    if a>=b and a>=c:
        a = a*2
        soma = a+b+c
    elif b>=a and b>=c:
        b = b*2
        soma = a+b+c
    else:
        c = c*2
        soma = a+b+c
    k = k-1

print(soma)

Solution (Python):
numeros = input()
numeros = numeros.split()
numeros = [int(i) for i in numeros]
nVezes = int(input())
for x in range(nVezes):
    for y in range(len(numeros)):
        if(numeros[y] == max(numeros)):
            numeros[y] = numeros[y] * 2

print(sum(numeros))

Solution (Python):
numeros = [int(x) for x in input().split()]
k = int(input())
index_maior = 0
maior = numeros[0]
for index, value in enumerate(numeros):
    if value > maior:
        maior = value
        index_maior = index
for _ in range(k):
    numeros[index_maior] *= 2
print(sum(numeros))

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

aux=max(A, B, C)
ans=(A+B+C)-aux

for _ in range(K):
  aux+=aux

print(aux+ans)

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

aux=max(A, B, C)
ans=(A+B+C)-aux

for _ in range(K):
  aux+=aux

print(aux+ans)

Solution (Python):
line = input()
nums = [int(n) for n in line.split()]
nums.sort()
k = int(input())
n = nums[-1]
for _ in range(k):
    n*=2
for num in nums[:2]:
    n+=num
print(n)

Solution (Python):
num = input()
A = int(num.split(' ')[0])
B = int(num.split(' ')[1])
C = int(num.split(' ')[2])
K = int(input())
num = [A,B,C]
while K>0:

    posi = num.index(max(num))
    num[posi]=num[posi]*2

    K=K-1

print(sum(num))

Solution (Python):
line = input()
numbers = [int(n) for n in line.split()]
numbers.sort()
K = int(input())
N = numbers[-1]
for _ in range(K):
    N*=2
for num in numbers[:2]:
    N+=num
print(N)

Solution (Python):
line = input()

a = [int(n) for n in line.split()]

k = int(input())

a.sort()
largest = a[-1]*2

for i in range(k-1):
    largest = largest * 2

a[-1] = largest
print(sum(a))

Solution (Python):
line = input()

a, b, c = [int(n) for n in line.split()]
k = int(input())

max_val = max(a, b, c)
max_val_mem = max_val

amax = False
bmax = False
cmax = False

for _ in range(k):
    max_val *= 2

if max_val_mem == a:
    amax = True
    print(str(max_val+ b+ c))
elif max_val_mem == b:
    bmax = True
    print(str(max_val+ a+ c))
elif max_val_mem == c:
    cmax = True
    print(str(max_val+ a+ b))

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

for _ in range(K):
    ABC[2] = ABC[2] * 2

print(sum(ABC))

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

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

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

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

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

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
list_ANS = [a, b, c]
list_ANS.sort(reverse=True)
d = list_ANS.pop(0)
for _ in range(k):
    d *= 2
list_ANS.append(d)
print(sum(list_ANS))

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):
num = sorted(list(map(int, input().split())))
k = int(input())
for i in range(k):
    num[-1] *= 2
print(sum(num))

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

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  List = list(map(int,input().split()))
  k = int(input())
  
  List = sorted(List,reverse=True)
  for _ in range(k):
    List[0] *= 2
  print(sum(List))
  
  
if __name__ == '__main__':
  main()

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

if __name__ == "__main__":
    main()

Solution (Python):
abc=list(map(int,input().split()))
k=int(input())
abc.sort()
for i in range(k):
    cn=abc.pop(-1)*2
    abc.append(cn)
print(sum(abc))

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

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

print(ans)

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 = list(map(int,input().split()))
k = int(input())
a.sort()
print(a[0]+a[1]+a[2]*(2**k))

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

for i in range(K):
    A[-1] *= 2

print(sum(A))

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

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

Solution (Python):

A = list(map(int,input().split()))
A.sort(reverse=True)
N = int(input())
ans = 0
for i,v in enumerate(A):
    if i == 0:
        ans += v*(2**N)
    else:
        ans += v
print(ans)

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

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=map(int,input().split())
k=int(input())
print((max([a,b,c]))*(2**k-1)+sum([a,b,c]))

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

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

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

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

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

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

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):
l = list(map(int, input().split()))
k = int(input())
MAX = max(l)
print(sum(l) + MAX * 2 ** k - MAX)

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

Solution (Python):

import math
import itertools
import statistics


A, B, C = list(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(A+B+C)

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

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,c = iim()
k = ii()

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

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

for i in range(K):
    A[-1] *= 2

print(sum(A))

Solution (Python):

def inputlist(): return [int(j) for j in input().split()]
from collections import Counter


li = inputlist()
K = int(input())
li.sort()
li[-1] = li[-1]*2**K
print(sum(li))

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

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

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

b = a.index(max(a))

ans = 0
for i in range(3):
    if (i == b):
        ans += a[i] * (2 ** k)
    else:
        ans += a[i]

print(ans)

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

Solution (Python):
A,B,C=list(map(int,input().split()))
K=int(input())
m=max([A,B,C])
k=m
for i in range(1,K+1):
    k=k*2
print(sum([A,B,C])-m+k)

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

    A.sort()
    print(sum(A[:-1])+A[-1]*2**k)


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
def Maximum_Sum(a , b , c , k):

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

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

if __name__ == '__main__':
    main()

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

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

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):
num=list(map(int,input().split()))
k=int(input())
ans1=sum(num)-max(num)
print(2**k*max(num)+ans1)

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

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

Solution (Python):
li=sorted(list(map(int,input().split())))
a=li.pop(-1)
k=int(input())
a=a*(2**k)
for i in li:
  a+=i
print(a)

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

    abc = [a, b, c]
    max_index = abc.index(max(a, b, c))
    ans = 0
    for i in range(3):
        num = abc[i]
        if i == max_index:
            for _ in range(k):
                num *= 2
            ans += num
        else:
            ans += num

    print(ans)


if __name__ == "__main__":
    main()

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

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

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

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

print(a+b+c+(m*2**k)-m)

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

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

Solution (Python):



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


max_cost = 0


if a>=b and a>=c:
    for i in range(k):
        a = a * 2
elif b>=a and b>=c:
    for i in range(k):
        b = b * 2
elif c>=a and c>=b:
    for i in range(k):
        c = c * 2

ans = a + b + c
print(ans)

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

m = max(N)
print(m * (2 ** K) + sum(N) - m)

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

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

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

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())
a=[A,B,C]
b=max(a)
a.remove(b)
print(b*2**K+sum(a))

Solution (Python):
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

abc = readints()
k = int(input())
x = sorted(abc)
xx = x[2]
for _ in range(k):
    xx *= 2
print(x[0]+x[1]+xx)

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

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

Solution (Python):








def resolve():
    A=sorted(list(map(int,input().split())), reverse=True)
    k=int(input())

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



    print(sum(A))




resolve()

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

print(sum(x))

Solution (Python):

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

x=max(a,b,c)
ans=a+b+c-x
for i in range(k):
    x*=2
ans+=x
print(ans)