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-----
5 3 11
1

-----Sample Output-----
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.
[{"code": "a,b,c=list(map(int,input().split()))\nk=int(input())\n\nx=max(a,b,c)\n\nprint(((a+b+c)-x+x*(2**k)))\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nk=int(input())\nprint(a+b+c+max(a,b,c)*(2**k-1))", "passed": true, "time": 0.24, "memory": 14244.0, "status": "done"}, {"code": "A, B, C = map(int, input().split())\nK = int(input())\n\nX = sorted([A, B, C])\nfor _ in range(K):\n    X[-1] *= 2\n    \nprint(sum(X))", "passed": true, "time": 0.17, "memory": 14324.0, "status": "done"}, {"code": "def ans096(A: int, B: int, C: int, K: int):\n    int_list = [A, B, C]\n    int_list.sort()\n    third=int_list[-1]\n    for i in range(K):\n        third*=2\n    return int_list[0]+int_list[1]+third\n\nA,B,C=map(int,input().split())\nK=int(input())\nprint(ans096(A,B,C,K))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "abc = list(map(int, input().split()))\nk = int(input())\n\nfor i in range(k):\n  abc.sort()\n  abc[2] *= 2\n  \nprint(sum(abc))", "passed": true, "time": 0.24, "memory": 14176.0, "status": "done"}, {"code": "a = sorted(map(int, input().split()))\nk = int(input())\nprint(a[0] + a[1] + a[2] * (2**k))", "passed": true, "time": 0.23, "memory": 14268.0, "status": "done"}, {"code": "import sys\nlines = [s.rstrip(\"\\n\") for s in sys.stdin.readlines()]\nnum_list = [int(num) for num in lines.pop(0).split(\" \")]\nk, = [int(num) for num in lines.pop(0).split(\" \")]\n\nm = max(num_list)\nans = sum(num_list) - m + (m * (2 ** k))\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "import math\n# b=input()\n# c=[]\n# for i in range(b):\n#     c.append(a[i])\na = list(map(int,input().split()))\n#b = list(map(int,input().split()))\ns=int(input())\n\nfor i in range(s):\n\ta[a.index(max(a))]=\ta[a.index(max(a))]*2\n\t\nprint(sum(a))", "passed": true, "time": 0.24, "memory": 14092.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nk = int(input())\nnum = max(l)\nl.remove(num)\nfor i in range(k):\n    num = num * 2\nprint(sum(l) + num)", "passed": true, "time": 0.24, "memory": 14148.0, "status": "done"}, {"code": "A,B,C=map(int, input().split())\nK=int(input())\n\nM=sorted([A,B,C])\nm=M[-1]\n\nm=m*2**K\n\nprint(m+M[0]+M[1])", "passed": true, "time": 0.19, "memory": 14200.0, "status": "done"}, {"code": "L = sorted(map(int, input().split()))\nk = int(input())\nprint(L[0]+L[1]+L[2]*2**k)", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "a, b, c = list(map(int, input().split()))\nK = int(input())\nm = max(a, b, c)\nprint((a + b + c + (2**K - 1) * m))\n", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nk = int(input())\nprint(a + b + c + max(a, b, c) * (2 ** k - 1))", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nk = int(input())\na.sort()\nprint(a[0] + a[1] + a[2] + (a[2] * (2 ** k - 1)))", "passed": true, "time": 0.23, "memory": 14096.0, "status": "done"}, {"code": "def main():\n    A = list(map(int, input().split()))\n    K = int(input())\n    A.sort()\n    A.append(A.pop()*(2**K))\n    print((sum(A)))\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "A,B,C = map (int, input ().split ())\nS = int (input ())\nif A>B>C or A>C>B:\n  for i in range (S):\n    A = A*2\n  print (A+B+C)\nelif B>A>C or B>C>A:\n  for i in range (S):\n    B = B*2\n  print (A+B+C)\nelse:\n  for i in range (S):\n    C = C*2\n  print (A+B+C)", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\nk = int(input())\n\nans = a+b+c + (max(a,b,c))*(2**k-1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}, {"code": "l=[int(x) for x in input().split()]\nk=int(input())\nm=max(l)\nl.remove(max(l))\nfor i in range(k):\n    m *= 2 \nprint(sum(l)+m)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "x = list(map(int, input().split()))\nfor i in range(int(input())):\n    x.sort()\n    x[-1]=x[-1]*2\nprint(sum(x))", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "X=list(map(int,input().split()))\nK=int(input())\nX.sort()\nfor i in range(K):\n    X[-1]=X[-1]*2\nprint(sum(X))", "passed": true, "time": 0.15, "memory": 14316.0, "status": "done"}, {"code": "a,b,c=list(map(int,input().split()))\nn=int(input())\n\na,b,c= sorted([a,b,c])\nprint((a+b+c*2**n))\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "A = list(map(int,input().split()))\nK = int(input())\n\nfor i in range(K):\n    max_A = max(A)\n    A.append(max_A * 2)\n    A.remove(max_A)\n\nprint(sum(A))", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nk = int(input())\n\nif max([a,b,c]) == c:\n    ans = c*(2**k) + b + a\nelif max([a,b,c]) == b:\n    ans = b*(2**k) + a + c\nelse:\n    ans = a*(2**k) + b + c\nprint(ans)", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "lis = list(map(int,input().split()))\na = int(input())\nlis.sort(reverse = True)\nfor i in range(a):\n    lis[0] *= 2\nprint(sum(lis))", "passed": true, "time": 0.16, "memory": 14016.0, "status": "done"}, {"code": "n = list(map(int,input().split()))\nk = int(input())\nfor _ in range(k):\n  n[n.index(max(n))] *= 2\nprint(sum(n)) ", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nk = int(input())\nl.sort()\nprint(l[2]*(2**k)+l[0]+l[1])", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "A = list(map(int,input().split()))\nK = int(input())\nfor _ in range(K):\n  A[A.index(max(A))]*=2\n\nprint(sum(A))", "passed": true, "time": 0.19, "memory": 14108.0, "status": "done"}, {"code": "a=list(map(int,input().split()))\nk=int(input())\nb=max(a)\nfor i in range(k):\n  b*=2\n  \nprint((sum(a)-max(a)+b))\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "A, B, C = map(int,input().split())\nK = int(input())\n\nn_list = [A, B, C]\nx = max(n_list)\nn_list.append(x * 2 ** K)\nn_list.remove(x)\nprint(sum(n_list))", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "def answer(a: int, b: int, c: int, k: int) -> int:\n    nums = sorted((a, b, c))\n    nums[-1] = nums[-1] * 2 ** k\n\n    return sum(nums)\n\n\ndef main():\n    a, b, c = list(map(int, input().split()))\n    k = int(input())\n    print((answer(a, b, c, k)))\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "display = sorted(list(map(int, input().split())))\nK = int(input())\n\nmaximum = display[-1]\nfor i in range(K):\n    maximum = maximum*2\n# print(maximum)\n# print(display[:-1])\n# print(sum(display[:-1]))\nprint(sum(display[:-1])+maximum)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "A, B, C = sorted([int(i) for i in input().split()])\nK = int(input())\nprint((A + B + (C * (2**K))))\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "l=list(map(int,input().split()))\nk=int(input())\n\nd=max(l)\ne=d*(2**k)\n\nl.remove(max(l))\nl.append(e)\n\nprint((sum(l)))\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "argList = list(map(int, input().split()))\nk = int(input())\nprint((sum(argList)-max(argList)) + max(argList)*2**k)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "A,B,C = map(int,input().split())\nMax = max(A,B,C)\nK = int(input())\nMax *= 2**K\nprint(min((A+B+Max),(A+Max+C),(Max+B+C)))", "passed": true, "time": 1.59, "memory": 14108.0, "status": "done"}, {"code": "l = list(map(int,input().split()))\nn = int(input())\nls = sorted(l)\nprint(ls[0]+ls[1]+ls[2]*(2**n))", "passed": true, "time": 0.15, "memory": 14144.0, "status": "done"}, {"code": "lst = input().split()\nK = int(input())\nfor i in range(3):\n   lst[i] = int(lst[i])\n\nprint(sum(lst) + (max(lst) *  ((2 ** K) - 1)))", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nk = int(input())\nfor i in range(k):\n    a = max(l)\n    i = l.index(a)\n    l[i] = l[i] * 2\n    \nprint(sum(l))", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "def mapt(fn, *args):\n    return tuple(map(fn, *args))\n\n\ndef Input():\n    return mapt(int, input().split(\" \"))\n\n\ndef main():\n    a, b, c = sorted(Input())\n    k = int(input())\n\n    for i in range(k):\n        c *= 2\n    print(a+b+c)\n\n\nmain()", "passed": true, "time": 0.28, "memory": 14304.0, "status": "done"}, {"code": "a,b,c=list(map(int,input().split()))\nk=int(input())\nprint(max([a,b,c])*2**k+sum([a,b,c])-max([a,b,c]))", "passed": true, "time": 0.28, "memory": 14108.0, "status": "done"}, {"code": "A,B,C = map(int,input().split())\nK = int(input())\n\nmax_num = max(A,B,C)\nif A == max_num:\n  print(A * (2 ** K) + B + C)\nelif B == max_num:\n  print(B * (2 ** K) + A + C)\nelse:\n  print(C * (2 ** K) + B + A)", "passed": true, "time": 0.22, "memory": 14324.0, "status": "done"}, {"code": "abc = list(map(int, input().split()))\nk = int(input())\nabc.sort()\nprint(sum(abc[:2] ,abc[-1] * (2 ** k)))", "passed": true, "time": 0.18, "memory": 14148.0, "status": "done"}, {"code": "N_List = list(map(int,input().split()))\nN = int(input())\nmaxN = max(N_List)\nprint(sum(N_List)-maxN+maxN*(2**N))", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "s=list(map(int,input().split()))\nk=int(input())\ns.sort()\nm=1\nm *= (s[2]*(2**k))\nprint(m+s[0]+s[1])", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\nk = int(input())\n\nm = max(a,b,c)\nre = sum([a,b,c]) - m\nprint(re + m*2**(k))", "passed": true, "time": 0.17, "memory": 14288.0, "status": "done"}, {"code": "ABC = [int(_) for _ in input().split()]\nK = int(input())\n\nABC = sorted(ABC)\n\nret = ABC[2]\nfor i in range(K):\n    ret = ret * 2\n\nret += sum(ABC[:2])\n\nprint(ret)", "passed": true, "time": 0.17, "memory": 14072.0, "status": "done"}, {"code": "a=list(map(int,input().split()))\nk=int(input())\nc=max(a[0],a[1],a[2])\nb=a[0]+a[1]+a[2]\nb=b-c\nfor i in range(0,k):\n    c=c*2\nprint(b+c)    ", "passed": true, "time": 0.21, "memory": 14180.0, "status": "done"}, {"code": "A, B, C = [int(i) for i in input().split()]\nK = int(input())\n\nm = max(A, B, C)\nprint((sum([A, B, C]) - m + m * 2 ** K))\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "num1, num2, num3 = map(int, input().split())\ncount = int(input())\n\nmax_num = max(num1, max(num2, num3))\n\nsum_num = num1 + num2 + num3 - max_num\nend_num = max_num\nfor i in range(count):\n    end_num *= 2\n\nprint(sum_num + end_num)", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "num_list = list(map(int, input().split()))\nk = int(input())\n\nmax = 0\nindex = -1\nfor i in num_list:\n    if max < i:\n        max = i\n        index = num_list.index(i)\n\nchange = max*(2**k)\nnum_list[index] = change\nans = 0\nfor j in num_list:\n    ans += j\n\nprint(ans)", "passed": true, "time": 0.17, "memory": 14244.0, "status": "done"}, {"code": "A, B, C = list(map(int,input().split()))\nK = int(input())\nNumbers = [A,B,C]\n\nNumbers.sort(reverse=True)\n\nfor i in range(K):\n    twice = Numbers[0] * 2\n    Numbers[0] = twice\n\nprint((sum(Numbers)))\n\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "mylists = list(map(int, input().split()))\nk = int(input())\n\nmylists.sort(reverse=True)\nprint((mylists[0] * 2 ** k - mylists[0] + sum(mylists)))\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nk = int(input())\nprint(max(a,b,c)*(2**k-1)+a+b+c)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "a = list(map(int,input().split()))\nk = int(input())\na.sort()\na[2] = a[2] *(2**k)\nprint(sum(a))", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nk = int(input())\ni = l.index(max(l))\nm = l[i]\ndel l[i]\nl.append(m * 2 ** k)\nprint((sum(l)))\n", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "n = [int(s) for s in input().split()]\nk = int(input())\n\nfor i in range(k):\n    max_id = n.index(max(n))\n    n[max_id] *= 2\nprint(sum(n)) ", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "a,b,c=list(map(int,input().split()))\nk=int(input())\nd=max(a,b,c)\nprint((a+b+c-d+d*2**k))\n", "passed": true, "time": 0.24, "memory": 14148.0, "status": "done"}, {"code": "a=[int(i) for i in input().split()]\nk=int(input())\n\nsum_a=sum(a)\n\nans=sum_a-max(a)+max(a)*2**k\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "abc = list(map(int, input().split()))\nk = int(input())\nfor i in range(k):\n    abc.sort()\n    abc[2] *= 2\nprint(sum(abc))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "A=list(map(int,input().split()))\nK=int(input())\nA.sort()\nA[2]=A[2]*2**K\nprint((sum(A)))\n", "passed": true, "time": 0.24, "memory": 14124.0, "status": "done"}, {"code": "ABC = sorted(map(int, input().split()))\nK = int(input())\n\nprint((ABC[0] + ABC[1] + ABC[2] * 2**K))\n", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "a = [int(x) for x in input().split()]\nk = int(input())\nprint(sum(a) - max(a) + max(a) * (2 ** k))", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "abc = list(map(int, input().split()))\nk = int(input())\nmx = abc.pop(abc.index(max(abc)))\nprint((mx * pow(2, k) + sum(abc)))\n", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "l = list(map(int,input().split()))\nk = int(input())\nl.sort(reverse=True)\nfor i in range(k):\n    l[0] *= 2\nprint(sum(l))", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\n\nabc = list(map(int, input().split()))\nk = int(input())\n\n\nabc.sort()\n\nprint((abc[0]+abc[1]+abc[2]*2**(k)))\n", "passed": true, "time": 0.23, "memory": 14376.0, "status": "done"}, {"code": "#\n# abc096 b\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n    def assertIO(self, input, output):\n        stdout, stdin = sys.stdout, sys.stdin\n        sys.stdout, sys.stdin = StringIO(), StringIO(input)\n        resolve()\n        sys.stdout.seek(0)\n        out = sys.stdout.read()[:-1]\n        sys.stdout, sys.stdin = stdout, stdin\n        self.assertEqual(out, output)\n\n    def test_\u5165\u529b\u4f8b_1(self):\n        input = \"\"\"5 3 11\n1\"\"\"\n        output = \"\"\"30\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_2(self):\n        input = \"\"\"3 3 4\n2\"\"\"\n        output = \"\"\"22\"\"\"\n        self.assertIO(input, output)\n\n\ndef resolve():\n    I = list(map(int, input().split()))\n    K = int(input())\n\n    for i in range(K):\n        t = max(I)\n        I.remove(t)\n        I.append(t*2)\n\n    print((sum(I)))\n\n\ndef __starting_point():\n    # unittest.main()\n    resolve()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14636.0, "status": "done"}, {"code": "A,B,C = sorted(map(int,input().split()))\nK=int(input())\n\nfor i in range(K):\n\tC*=2\n\nprint((A+B+C))\n", "passed": true, "time": 0.22, "memory": 14220.0, "status": "done"}, {"code": "nums = list(map(int, input().split()))\nk = int(input())\nx = max(nums)\nmulx = x*(2**k)\nprint((mulx + sum(nums)-x))\n", "passed": true, "time": 0.22, "memory": 14340.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\nk = int(input())\nans = a+b+c+max(a,b,c)*(2**k-1)\nprint(ans)", "passed": true, "time": 0.22, "memory": 14360.0, "status": "done"}, {"code": "def resolve():\n    a = list(map(int, input().split()))\n    k = int(input())\n    a.sort()\n    for i in range(k):\n        a[2] = a[2] * 2\n    print(sum(a))\nresolve()", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "ABC = list(map(int, input().split()))\nK = int(input())\n\nprint(max(ABC)*(2**K - 1) + sum(ABC))", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "A, B, C = map(int, input().split())\nK = int(input())\nif max(A, B, C) == A:\n    A *= 2**K\nelif max(A, B, C) == B:\n    B *= 2**K\nelse:\n    C *= 2**K\nprint(A+B+C)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "List =  list(map(int, input().split()))\nK = int(input())\nsort = sorted(List)\nfor i in range(K):\n    sort[-1] = sort[-1]*2\nprint((sum(sort)))    \n", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nk = int(input())\na.sort(reverse=True)\na[0] *= 2**k\nprint(sum(a))", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nk = int(input())\nprint(max(a,b,c)*(2**k-1)+a+b+c)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "a,b,c=sorted(map(int,input().split()))\nprint(a+b+pow(2,int(input())  )*c )", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "A=list(map(int,input().split()))\nK=int(input())\n\nans=sum(A)\nans+=max(A)*(2**K-1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nk = int(input())\nprint(max(a,b,c)*(2**k-1)+a+b+c)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "import heapq\n\nval = list(map(lambda x: -int(x), input().split()))\nK = int(input())\n\nheapq.heapify(val)\n\nfor i in range(K):\n    v = heapq.heappop(val)\n    heapq.heappush(val, v * 2)\n\nprint(-sum(val))", "passed": true, "time": 0.16, "memory": 14308.0, "status": "done"}, {"code": "A=list(map(int,input().split()))\n\nK=int(input())\n\nA.sort(reverse=True)\n\nprint((A[0]*2**K+A[1]+A[2]))\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "l = list(map(int,input().split()))\nn = int(input())\nls = sorted(l)\nprint(ls[0]+ls[1]+ls[2]*(2**n))", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "A = list(map(int,input().split()))\nK = int(input())\n\nfor i in range(K):\n    max_A = max(A)\n    A.append(max_A * 2)\n    A.remove(max_A)\n\nprint(sum(A))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "nums = sorted(list(map(int, input().split())), reverse=True)\nK = int(input())\n\nprint(nums[0]*(2**K) + nums[1] + nums[2])", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "a,b,c=list(map(int,input().split()))\nk=int(input())\nprint((a+b+c-max(a,b,c)+max(a,b,c)*pow(2,k)))\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "import bisect, collections, copy, heapq, itertools, math, string, sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = float('inf')\ndef I(): return int(input())\ndef F(): return float(input())\ndef SS(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LSS(): return input().split()\n\ndef resolve():\n    ABC = LI()\n    K = I()\n    ABC.sort()\n\n    ans = sum(ABC[:2]) + ABC[2] * 2 ** K\n    print(ans)\n\ndef __starting_point():\n    resolve()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14124.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nk = int(input())\n\na.sort()\n\nprint(sum(a[:-1]) + a[-1] * 2 ** k)", "passed": true, "time": 0.22, "memory": 14056.0, "status": "done"}, {"code": "m, *A = sorted([int(x) for x in input().split()], reverse=True)\nK = int(input())\n  \nprint((m * 2**K) + sum(A))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\nk = int(input())\nl = [a,b,c]\nl.sort()\nprint(l[-1]*2**k + sum(l[:-1]))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nk = int(input())\nx = max(a, b, c)\nif x == a:\n    print(a*2**k + b + c)\nelif x == b:\n    print(a + b*2**k + c)\nelse:\n    print(a + b + c*2**k)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nk = int(input())\nm = max(a, b, c)\n\nfor i in range(k):\n  m *= 2\n  \nprint(sum([a, b, c]) - max(a, b, c) + m)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "A, B, C = map(int, input().split())\nK = int(input())\nprint(sum([A, B, C])+max(A, B, C)*2**K-max(A, B, C))", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "a=list(map(int,input().split()))\nb=int(input())\na.sort()\nprint(a[0]+a[1]+(a[2]*(2**b)))", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nk = int(input())\nl.sort()\nprint(l[0] + l[1] + l[2] * (2 ** k))", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "a = sorted(list(map(int, input().split())))\nm = a.pop()\nfor i in range(int(input())):\n  m *= 2\nprint(sum(a) + m)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "list_abc = sorted([int(i) for i in input().split()])\nk = int(input())\nprint(list_abc[2] * 2 ** k + sum(list_abc[:2]))", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nk=int(input())\nprint((2**k-1)*max([a,b,c])+sum([a,b,c]))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\na.sort()\nk = int(input())\nres = a[0] + a[1] + a[2] * (2 ** k)\nprint(res)\n", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\nk = int(input())\nprint(a+b+c+max(a,b,c)*((2**k)-1))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nk = int(input())\n\na.sort()\na[-1] *= 2 ** k\n\nprint((sum(a)))\n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}]