You have decided to give an allowance to your child depending on the outcome of the game that he will play now.
The game is played as follows:
 - There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a + printed on it.
 - The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
 - Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq A, B, C \leq 9

-----Input-----
Input is given from Standard Input in the following format:
A B C

-----Output-----
Print the maximum possible amount of the allowance.

-----Sample Input-----
1 5 2

-----Sample Output-----
53

The amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.

Difficulty: introductory

Starter code:

Solutions:
a=input().split()
a.sort(reverse=True)
if len(set(a))==1:
  print(12*int(a[0]))
else:
  ans=int(a[0]+a[1])+int(a[2])
  print(ans)

a, b, c = map(int, input().split())
if a >= b and a >= c:
    print(a * 10 + b + c)
elif b >= a and b >= c:
    print(b * 10 + a + c)
else:
    print(c * 10 + a + b)

nums = list(map(int, input().split()))

nums.sort()
print(nums[2] * 10 + nums[1] + nums[0])

x = []
x = list(input().split())
x.sort(reverse=True)

print((int(x[0]+x[1])+int(x[2])))




a,b,c = map(int, input().split())
print(max(a,b,c) * 9 +a + b + c)

a,b,c=sorted(map(int,input().split()))
print(10*c+a+b)

num = sorted(list(map(int, input().split())), reverse=True)
print(num[0] * 10 + sum(num[1:]))

a, b, c = sorted(map(int, input().split()))
print((10*c+a+b))


#ABC110A
a = sorted(list(map(int,input().split())))
print(a[2]*10+a[1]+a[0])

A=list(map(int,input().split()))

A.sort()
A=A[::-1]

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


x = list(map(int, input().split()))
a = max(x)
b = min(x)
x.remove(a)
x.remove(b)
c = x[0]
a = str(a)
b = str(b)
ab = int(a+b)
print(ab+c)

abc=sorted(list(map(int,input().split())),reverse=True)
print((sum(abc)+abc[0]*9))


a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
ls=[a,b,c]
ls.sort()
print(ls[2]*10+ls[1]+ls[0])

a,b,c=map(int,input().split())
print(max(a,b,c)*9+a+b+c)

#!/usr/bin/env python3

def main():
    abc = sorted(input().split())
    print((int(abc[2]) * 10 + int(abc[1]) + int(abc[0])))


def __starting_point():
    main()

__starting_point()

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A = list(map(int, readline().split()))
    A.sort()
    print((A[0] + A[1] + A[2] * 10))

    return


def __starting_point():
    main()

__starting_point()


S=list(map(int,input().split()))
S.sort()
all=0
all += (S[0]+10*S[2]+S[1])
print(all)

a, b, c = map(int, input().split())
print(max(a*10+b+c, a+b*10+c, a+b+c*10))

a = sorted(list(map(int, input().split())),reverse=True)
print((a[0]*10+a[1]+a[2]))


n = list(map(int, input().split()))
list_num = list(n)
list_num.sort()
list_str = []
for i in list_num:
    i = str(i)
    list_str.append(i)

max_str = list_str[-1] + list_str[1]
max_int = int(max_str)
print((max_int + int(list_str[0])))


A,B,C = map(int,input().split())
ans = 0
if(A>=B and A>=C):
    ans = max(A*10+B+C,ans)
if(B>=A and B>=C):
    ans = max(B*10+A+C,ans)
else:
    ans = max(C*10+A+B,ans)
print(str(ans))

l=input().split()
ld = sorted(l, reverse=True)
#print(ld)
a=ld[0]+ld[1]
b=ld[2]
m=int(a)
n=int(b)
print((m+n))


abc = list(map(int, input().split()))
print((sum(abc) + max(abc) * 9))


a = list(map(int, input().split()))
print(10 * max(a) + sum(a) - max(a))

A,B,C=map(int,input().split())
print(max(A*10+B+C,B*10+A+C,C*10+B+A))

A, B, C = map(int, input().split())
ABC = sorted([A, B, C])
print(ABC[-1]*10 + sum(ABC[:2]))

A, B, C = map(int, input().split())
lst = [A, B, C]
lst2 = sorted(lst, reverse=True)
lst3 = list(map(str, lst2))
print(int(lst3[0] + lst3[1]) + int(lst3[2]))

a = sorted(map(int, input().split()))
print(a[2]*10 + a[1] + a[0])

a,b,c=map(int, input().split())
print(a+b+c+9*max(a,b,c))

X = list(map(int, input().split()))
print((sum(X)+9*max(X)))


L = list(map(str, input().split()))
L.sort()
a = int(L[2]+L[1])
b = int(L[0])
print(a + b)

#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [input() for _ in range(n)]

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

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




import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    num = list(map(int, input().split()))
    num.sort(reverse=True)
    print((num[0]*10+num[1] + num[2]))

def __starting_point():
    main()

__starting_point()

abc = list(map(str, input().split()))
abc.sort()
print(int(abc[2]+abc[1])+int(abc[0]))

a,b,c = map(int,input().split())
print(max(a,b,c)*9+a+b+c)

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

a.sort(reverse=True)

ans=a[0]*10+a[1]+a[2]
print(ans)

a = list(map(int,input().split()))
a.sort()
print(a[-1]*10+a[-2]+a[-3])

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

a,b,c = input().split()

if a == max(a,b,c):
    ans = int(a+b) + int(c)
elif b == max(a,b,c):
    ans = int(b+a) + int(c)
else:
    ans = int(c+a) + int(b)
print(ans)

a,b,c = map(int,input().split())
print(max(a,b,c)*9+sum([a,b,c]))

a = sorted(list(map(int, input().split())))
print((a[0]+a[1]+a[2]*10))


a, b, c = map(int, input().split())
print(max(a, b, c) * 9 + a + b + c)

a, b, c = map(int, input().split())
M = max(a, b, c)
r = a+b+c-M

print(10*M + r)

num=list(map(int,input().split()))
num.sort()
ans=num[2]*10+num[1]+num[0]
print(ans)

A=list(map(int,input().split()))
A.sort(reverse=True)
print((10*A[0]+A[1]+A[2]))


l = sorted(map(int, input().split()))
print(l[2]*10 + l[1] + l[0])

n_l = list(map(str, input().split()))

n_l.sort(reverse=True)

print((int(n_l[0] + n_l[1]) + int(n_l[-1])))


s = list(map(int,input().split()))
s.sort(reverse = True)
print(s[0]*10+s[1]+s[2])

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

d = max(a,b,c)
print(d*9+a+b+c)

val = list(map(int, input().split()))
val.sort(reverse=True)
print(val[0] * 10 + val[1] + val[2])

a,b,c =map(int,input().split())
print(max(a,b,c)*9+a+b+c)

a = sorted(list(map(int, input().split())),reverse=True)
print((sum(a)+a[0]*9))



def main():
    a = list(map(int, input().split()))
    sorted_a = sorted(a)
    print((int(str(sorted_a[2]) + str(sorted_a[1])) + sorted_a[0]))


def __starting_point():
    main()

__starting_point()

n = list(map(int,input().split()))
m=sorted(n)
print(int((m[2]*10+m[1])+m[0]))

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

print(10*a[-1] + a[0] + a[1])

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

a.sort()

print(a[-1] * 10 + a[0] + a[1])

a,b,c = map(int, input().split())
print(max(10*a+b+c, a+10*b+c, a+b+10*c))

a = sorted(list(input().split()))
ans = int(a[0])+int(a[2]+a[1])
print(ans)


abc=sorted(list(map(int,input().split())),reverse=True)
a=[1]*10
for i in range(10**7):
    a.append(a)
print((sum(abc)+abc[0]*9))


a,b,c=map(int,input().split())
if a>=b and a>=c:
  print(10*a+b+c)
elif  b>=a and b>=c:
  print(a+10*b+c)
else:
  print(a+b+10*c)

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

print((a[-1]*10+sum(a[:-1])))



a,b,c = sorted(map(int,input().split()))
print((c*10+b+a))


abc = list(map(int, input().split()))
abc = sorted(abc, reverse=True)
ab = str(abc[0])+str(abc[1])
c = int(abc[2])
print(int(ab)+int(c))

n = list(map(int, input().split()))
n.sort()
print(n[0] + n[1]+n[2]*10)

import os
l = list(map(int,input().split()))
l.sort()
a =l[2]*10+l[1]+l[0]
print(a)


l=list(map(str,input().split()))
l.sort()
a=l[0]
b=l[2]+l[1]
print(int(b)+int(a))

l = list(map(int, input().split()))
l.sort(reverse=True)
print(10*l[0]+1*l[1]+l[2])

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


l = [int (x) for x in input().split()]
list.sort (l)
print (l[-1]*10+l[0]+l[1])

A,B,C = sorted(map(int,input().split()))
print(C*10+B+A)

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

# ABC110
# A Maximize the Fomula
Num = list(map(int, input().split()))
Num = sorted(Num, reverse=True)
X = []
for i in range(2):
    X.append(str(Num[i]))
X = int("".join(X))
Y = int(Num[2])
print((X + Y))


def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    data = sorted(Input(), reverse=True)
    print(int(str(data[0])+str(data[1])) + data[2])


main()

lis = []
li = input().split()

li.sort()

lis.append(li[2] + li[1])
lis.append(li[0])

print((int(lis[0]) + int(lis[1])))


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



print(max((a,b,c))*9 + a+b+c)

a = list(map(int,input().split()))
a = sorted(a,reverse=True)
print((10*a[0]+a[1]+a[2]))




lst = list(map(int, input().split()))
lst.sort()
lst.reverse()
maximum = int(str(lst[0]) + str(lst[1])) + lst[2]
print(maximum)

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

res = a[0] * 10 + a[1] + a[2]
print(res)

a = list(input().split())
a.sort()

x = a[0]
y = a[2]+a[1]

print(int(x)+int(y))

list01 = list(map(int, input().split()))
list02 = sorted(list01, reverse=True)
a = list02[0] * 10 + list02[1] + list02[2]
print(a)

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

t = sorted([A, B, C])
print(t[0] + t[1] + t[2] * 10)

l = list(map(int, input().split()))
i = l.index(max(l))
print(l.pop(i) * 10 + sum(l))

a, b, c = map(int, input().split())
if a <= b and b <= c:
    print(int(str(c) + str(b)) + a)
elif c <= b and b <= a:
    print(int(str(a) + str(b)) + c)
elif a <= c and c <= b:
    print(int(str(b) + str(c)) + a)
elif b <= c and c <= a:
    print(int(str(a) + str(c)) + b)
elif b <= a and a <= c:
    print(int(str(c) + str(a)) + b)
else:
    print(int(str(b) + str(a)) + c)

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

print(10*c+b+a)

li_1=a,b,c=list(map(int,input().split()))
li=sorted(li_1, reverse=True)
print(int(str(li[0])+str(li[1]))+li[2])

A,B,C = input().split()
ls = [int(A+B)+int(C),int(B+A)+int(C),int(A)+int(B+C),int(A)+int(C+B),int(B)+int(A+C),int(B)+int(C+A)]
print(max(ls))

a = list(input().split())
b = sorted(a)
print(int(b[2]+b[1]) + int(b[0]))

A = list(map(int,input().split()))
A = sorted(A, reverse=True)
print(int("".join(map(str,A[:2]))) + A[-1])

import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return list(map(int, stdin.readline().split()))
def nl(): return list(map(int, stdin.readline().split()))


def main():
    A = sorted(nl())
    print((eval(str(A[2]) + str(A[1]) + '+' + str(A[0]))))


def __starting_point():
    main()

__starting_point()

a = list(map(int,input().split()))
sort_a = sorted(a,reverse=True)
tmp = int(str(sort_a[0])+str(sort_a[1]))+sort_a[2]
print(tmp)

abc=sorted(list(map(int,input().split())),reverse=True)
a=[1]*10
for i in range(10**7+5*10**6):
    a.append(a)
print((sum(abc)+abc[0]*9))



url = "https://atcoder.jp//contests/abc110/tasks/abc110_a"

def main():
    t = list(map(int, input().split()))
    t.sort(reverse=True)

    print((t[0]*10 + t[1] + t[2]))

def __starting_point():
    main()

__starting_point()

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

print(10 * c + b +a)

ABC = input().split()
m = max(ABC)
ABC.remove(m)

print(eval(m + ABC[0] + '+' + ABC[1]))

L = list(map(int,input().split()))
L.sort()
print(L[2] * 10 + L[1] + L[0])

a,b,c=map(int,input().split())
print(max(a,b,c)*9+a+b+c)

a=sorted(list(input().split()))
print(int(a[2])*10+int(a[0])+int(a[1]))

a, b, c = map(int, input().split())
X = 10 * a + b + c
Y = a + 10 * b + c
Z = a + b + 10 * c
print(max(X, max(Y, Z)))

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

if A >= B and A >= C:
  print((int(A*10+B+C)))
elif B >= A and B >= C:
  print((int(B*10+A+C)))
else:
  print((int(C*10+A+B)))