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

Solution (Python):


A,B,C = list(map(int, input().rstrip().split()))
K = int(input().strip())


num_list = sorted( [A,B,C] )
ans = sum(num_list) - num_list[-1] + num_list[-1] * (2**K)
print(ans)

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

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

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

print((max_num) * pow(2, K) + sum([A, B, C]) - max_num)

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):
ABC = list(map(int, input().split()))
K = int(input())

maxnum = max(ABC)
ABC.remove(maxnum)
ans = maxnum * (2**K)
print(sum(ABC) + ans)

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

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

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

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

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

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

Solution (Python):


num = list(map(int, input().split()))
K = int(input())

num.sort(reverse=True)

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

print(sum(num))

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

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

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

l.sort()
for _ in range(k):
    l[2] *= 2

print(sum(l))

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

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

print(sum(N))

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

t.sort()

n=int(input())

for i in range(n):
    t[-1] *= 2
print(sum(t))

Solution (Python):

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

Solution (Python):


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

for i in range(k):
    a[-1] *= 2
    a = sorted(a)
print(sum(a))

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

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

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

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

print(sum(a))

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

s = sum(i)
s = s + max(i)*(2**(n)-1)

print(s)

Solution (Python):
li = [ int(x) for x in input().split() ]
K = int(input())

li.sort()

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

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

x=max(a,b,c)

for i in range(1,k+1):
  x = x*2
  
  
kk =  (a+b+c)-(max(a,b,c)) + int(x)

print(kk)

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

abc_MAX=max(A,B,C)

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

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

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

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

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):


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

a_L = sorted(a_L,reverse=True)
a_L[0] = a_L[0] * 2**k


print(sum(a_L))

Solution (Python):
ABC=list(map(int,input().split()))
K=int(input())
for k in range(K):
    maximum=max(ABC)
    ABC.remove(maximum)
    ABC.append(maximum*2)
print(sum(ABC))

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

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

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

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

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

Solution (Python):

l=list(map(int,input().split()))
k=int(input())
s=max(l)
ans=sum(l)-s
ans+=s*pow(2,k)

print(ans)

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

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

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

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

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

k=int(input())

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

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

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

Solution (Python):
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

a, b, c = na()
k = ni()
m = max(a, b, c)
print(a + b + c + m * (2 ** k - 1))

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

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

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

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

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

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

print(sum(abc))

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

maxi = max(a, max(b, c))
ans = a + b + c - maxi

for i in range(k):
    maxi *= 2
print(ans + maxi)

Solution (Python):


n_list = list(map(int, input().split()))
K = int(input().split()[0])

n_list = list(sorted(n_list, reverse=True))
n = n_list[0]
for _ in range(K):
    n = n * 2
ans = n + n_list[1] + n_list[2]
print(ans)

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

print(sum(n)+max(n)*sum(2**i for i in range(k)))

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

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

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7



ABC = list(map(int, sys.stdin.buffer.readline().split()))
K = int(sys.stdin.buffer.readline())

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

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

Solution (Python):
l = list(map(int, input().split()))
k = int(input())
l = sorted(l, reverse=1)
a=l.pop(0)
l.append(a*2**k)
print(sum(l))

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

while k > 0:
    abc.sort()
    abc[2] = abc[2] * 2
    k -= 1

print(sum(abc))

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

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

D = max(A,B,C)
if D == A:
    S = B + C + A*2**K
elif D == B:
    S = A + C + B*2**K
else:
    S = B + A + C*2**K

print(S)

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

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

max_num = nums.pop(nums.index(max(nums)))

max_sum = sum(nums) + (max_num * (2 **k))

print(max_sum)

Solution (Python):
a, b, c = input().split(" ")
k = int(input())
lis = [int(a), int(b), int(c)]
lis.sort(reverse = True)

for _ in range(1, k+1):
  m = max(lis) * 2
  lis[0] = m

print(sum(lis))

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

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

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

Solution (Python):
def main():
    numbers = list(map(int, input().split(" ")))
    double_time = int(input())
    numbers.sort()
    for i in range(double_time):
        numbers[-1] *= 2
    print(sum(numbers))


if __name__ == '__main__':
    main()

Solution (Python):
a, b, c = sorted(map(int, input().split()), reverse=True)
print(sum([a << int(input()), b, c]))

Solution (Python):
l = list(map(int, input().split()))
K = int(input())
l.sort()
a = l.pop()
print((2 ** K) * a + sum(l))

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

Solution (Python):
L=list(map(int,input().split()))
k=int(input())
M=L.pop(L.index(max(L)))
for _ in range(k):
    M=M*2
print(sum(L)+M)

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

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

for i in range(3):
    if max(ll) == ll[i]:
        ll[i] = ll[i]*(2**k)
print(sum(ll))

Solution (Python):




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

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


if __name__ == "__main__":
    main()

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b,c=INTM()
    k=INT()
    d=max(a,b,c)
    e=d*(2**k)
    ans=a+b+c+e-d
    print(ans)
    
if __name__ == '__main__':
    do()

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

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, B, C = map(int, input().split())
K = int(input())

d = max(A, B, C)
e = d * 2**K

print(e+A+B+C-d)

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


arr.sort()

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

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

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

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

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

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

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

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

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

max_value = max([a, b, c])

res = max_value *(2**k) + a + b + c - max_value

print(res)

Solution (Python):


nums = list(map(int, input().split()))
k = int(input())
maxNum = max(nums)

for i in range(k):
    nums[nums.index(maxNum)] = maxNum * 2
    maxNum = maxNum * 2

print(sum(nums))

Solution (Python):
l=sorted([int(x) for x in input().split()],reverse=True)
k=int(input())

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

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

n = sum(sorted(a)[:-1])
s = sorted(a)[-1]

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

print(n + s)

Solution (Python):
l = list(map(int,input().split()))
k = int(input())
print(sum(l)+max(l)*(2**k-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=list(map(int,input().split()))
k=int(input())
for _ in range(k):
  a.sort()
  a[2]*=2
print(sum(a))

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

m = max(a)
a.remove(m)
print(m*2**k + sum(a))

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

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

a1 = sorted(a)

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

Solution (Python):
nums = list(map(int, input().split(' ')))
k = input()
k = int(k)
i = 0

for i in range(k):
  maxindex = max(enumerate(nums), key = lambda x:x[1])[0]
  nums[maxindex] *= 2
  i = i + 1

print(sum(nums))

Solution (Python):
nums = list(map(int, input().split(' ')))
k = input()
k = int(k)
i = 0

while i in range(k):
  maxindex = max(enumerate(nums), key = lambda x:x[1])[0]
  nums[maxindex] *= 2
  i = i + 1

print(sum(nums))

Solution (Python):
a= list(map(int, input().split()))
k = int(input())
tmp = max(a)
ans = max(a)
for i in range(k):
  ans *= 2
print(sum(a)+ans-tmp)

Solution (Python):
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

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

l = many_int()
K=one_int()

M=max(l)

l.remove(M)

print(M*(2**K)+sum(l))

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

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

aa = sorted(a)
ans = aa[0]+aa[1]+aa[2]*(2**k)
print(ans)

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

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

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())
l=[A,B,C]
l.sort(reverse=True)

print(int(l[0]*pow(2,K)+l[1]+l[2]))

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

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

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

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())
print(a+b+c+max(a,b,c)*(2**k-1))

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

Solution (Python):

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
a,b,c = map(int,input().split())
k = int(input())
print((2**k-1)*max([a,b,c])+sum([a,b,c]))

Solution (Python):
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys




read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A = [int(x) for x in readline().split()]
K = int(readline())
A.sort()

A[-1] = A[-1] * 2 ** K
print(sum(A))

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

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

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

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

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

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

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

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

Solution (Python):
a, b, c = map(int, raw_input().split())
k = 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())
largest = max(A, B, C)

ans = A + B + C + largest * (2 ** K - 1)

print(ans)

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

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

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

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

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

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

ans = 0
for i in range(k+1):
    for j in range(k+1):
        if i+j <= k:
            ans = max(ans, a*2**i+b*2**j+c*2**(k-i-j))

print(ans)

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

print(sum(ABC[:2]) + (ABC[-1]) * (2 ** K))

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

Solution (Python):

items=list(map(int, input().split()))
K=int(input())
max_index = items.index(max(items))
for i in range(K):
    items[max_index] = items[max_index] * 2

print(sum(items))

Solution (Python):
A = [int(a) for a in input().split()]
A.sort()
K = int(input())
print(A[0] + A[1] + A[2] * 2 ** K)

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

ABC_1 = sorted(ABC)

ABC_1[-1] = ABC_1[-1]*2**K

print(sum(ABC_1))

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

for i in range(k):
    max_value = max(a)
    max_index = a.index(max_value)
    a[max_index] = a[max_index] * 2
print(sum(a))

Solution (Python):

a,b,c=map(int,input().split())
K=int(input())
l=[a,b,c]
m=max(l)
ans=0
ans+=m*2**K
i=l.index(m)
del l[i]
ans+=sum(l)
print(ans)

Solution (Python):


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

L=[A,B,C]
L.sort()

ans=L[0]+L[1]+L[2]*(2**K)

print(ans)

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

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

print(ans)

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

nums = [A, B, C]
m = max(A, B, C)
nums.remove(m)
print(sum(nums) + m * (2 ** K))

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

x = [a, b, c]
for i in range(k):
   x[x.index(max(x))] = max(x) * 2
print(sum(x))

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

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

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

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

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

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(a+b+c+max(a,b,c)*(2**k-1))

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

Solution (Python):
import sys
input = sys.stdin.readline
li = [int(i) for i in input().split()]
K = int(input())
li.sort()
ans = 0
li[-1] *= 2 **K
for i in range(3) :
    ans += li[i]
print(ans)

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

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

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

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

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

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

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

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

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

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

print(li[-1]*(2**k)+li[0]+li[1])

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

if ma == a:
  print(a*(2**k)+b+c)
elif ma == b:
  print(b*(2**k)+a+c)
elif ma == c:
  print(c*(2**k)+a+b)

Solution (Python):
import sys
input = sys.stdin.readline
A = [int(x) for x in input().split()]
K = int(input())
m = 2 ** K
A.sort()
print(A[0] + A[1] + m * A[2])

Solution (Python):

 
import math
import itertools
import sys
import copy
 




L = list(map(int, input().split()))
K = int(input())
L.sort(reverse=True)

sum = L[0]
for _ in range(K) :
  sum *= 2
sum += L[1]
sum += L[2]

print (sum)

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

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

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

print(sum(v))

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

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

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

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

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

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

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

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

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

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

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())
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):
ABC = sorted([int(i) for i in input().split()])
K = int(input())

print(sum(ABC[:2]) + (ABC[-1] << K))

Solution (Python):
import sys

*a, k = map(int, sys.stdin.read().split())

def main():
    a.sort()
    return sum(a[:2]) + a[-1] * 2 ** k

if __name__ == '__main__':
    ans = main()
    print(ans)

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

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

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


sum = A + B + C
max_num = max(A, B, C)
sum -= max_num
for i in range(N):
  max_num *= 2
sum += max_num
print(sum)

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

Solution (Python):


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

mx = max(a,b,c)
lis = [a,b,c]
lis.remove(mx)


print(mx*2**k+sum(lis))

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

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

n[-1] = n[-1]*(2**k)
print(sum(n))

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

for _ in range(k):
    n[-1] = n[-1]*2

print(sum(n))

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
N = [A, B, C]
for i in range(K):
  n = N.index(max(N))
  N[n] = 2 * N[n]
print(sum(N))

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

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

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

Solution (Python):
L=sorted(list(map(int,input().split())))
k=int(input())
print(L[0]+L[1]+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())
p = [a,b,c]
p.sort()
x = p[0]
y = p[1]
z = p[2]
ans = p[0]+p[1] +p[2]*2**(k)
print(ans)

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

m = max([a,b,c])

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

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

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

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

Solution (Python):

n = list(map(int, input().split()))
num = sorted(n)
k = int(input())
ans = 0

for _ in range(k):
    ans = sum(num[0:2]) + num[2]*2
    num[2] = num[2]*2

print(ans)

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

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

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

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

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


print(sum(li))

Solution (Python):
N=list(map(int,input().split()))
K=int(input())
NN = sorted(N, reverse=True)

print(NN[0] * 2 ** K + sum(NN[1:]))

Solution (Python):
a=list(map(int,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())
x=sorted([a,b,c])
print(x[0]+x[1]+x[2]*2**k)

Solution (Python):




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

a.sort()

memo = 1<<k

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

Solution (Python):

import sys


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



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

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()))
K=int(input())
print(sum(A)+max(A)*(2**K-1))

Solution (Python):

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

"""
for i in range(k):
    D = [a,b,c]
    D.sort()
    D[2] = 2 * D[2]
ans = a + b + c
print(ans)
"""

D = [a,b,c]
D.sort()
ans = D[0] + D[1] + D[2] * 2 ** k
print(ans)

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

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

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

for i in range(k):
    l.append(max(l)*2)
    l.remove(max(l)/2)

print(sum(l))

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