Harryxun/stf_run huggingface dataset:
N, K = map(int, input().split())
a_array = [int(i) for i in input().split()]

right_counter = 0
all_counter = 0
multier = K * (K-1) / 2
if multier >= 10 ** 9 + 7:
    multier %= (10 ** 9 + 7)
threshold = -(-(10 ** 9 + 7) // multier)
threshold_right = -(-(10 ** 9 + 7) // K)
for i in range(N):
    a_i = a_array[i]
    left_over = 0
    right_over = 0
    for j in range(i):
        if a_array[j] < a_i:
            left_over += 1
    for j in range(i+1, N):
        if a_array[j] < a_i:
            right_over += 1
    right_counter += right_over
    all_counter += right_over + left_over
    if right_counter >= threshold_right:
        right_counter %= threshold_right
    if all_counter >= threshold:
        all_counter %= threshold
sum = all_counter * multier + right_counter * K
sum %= (10 ** 9 + 7)
print(int(sum))

### FIXED CODE ###

N, K = map(int, input().split())
a_array = [int(i) for i in input().split()]

countR=0
countA=0

for i in range(N):
    for j in range(i+1, N):
        if a_array[i] > a_array[j]:
            countR += 1

    for j in range(N):
        if a_array[i] > a_array[j]:
            countA += 1

print(int((countR * K + countA * K * (K-1) // 2)%(10**9+7)))
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
from bisect import bisect_left, bisect_right
import random
from itertools import permutations, accumulate, combinations
import sys
import string



INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


n, k = LI()
dp = [[[0]*n**2*3 for _ in range(n+1)] for _ in range(n+1)]
dp[0][0][0] = 1
for i in range(n):
    for j in range(i+1):
        for l in range(k+1):
            dp[i+1][j+1][l+2*(j+1)] += dp[i][j][l]
            dp[i+1][j+1][l+2*(j+1)]%=mod
            dp[i+1][j][l+2*j] += dp[i][j][l]*(j*2+1)
            dp[i+1][j][l+2 * j] %= mod
            if j != 0:
                dp[i+1][j-1][l+(j-1)*2] += dp[i][j][l]*j*j
                dp[i+1][j-1][l+(j-1)*2]%=mod



print(dp[n][0][k]%mod)



### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
from bisect import bisect_left, bisect_right
import random
from itertools import permutations, accumulate, combinations
import sys
import string



INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


n, k = LI()
dp = [[[0]*n**2*4 for _ in range(n+1)] for _ in range(n+1)]
dp[0][0][0] = 1
for i in range(n):
    for j in range(i+1):
        for l in range(k+1):
            dp[i+1][j+1][l+2*(j+1)] += dp[i][j][l]
            dp[i+1][j+1][l+2*(j+1)]%=mod
            dp[i+1][j][l+2*j] += dp[i][j][l]*(j*2+1)
            dp[i+1][j][l+2 * j] %= mod
            if j!= 0:
                dp[i+1][j-1][l+(j-1)*2] += dp[i][j][l]*j*j
                dp[i+1][j-1][l+(j-1)*2]%=mod



print(dp[n][0][k]%mod)
n, k, c = map(int, input().split())
ss = list(input())

wd = [i for i, e in enumerate(ss) if e == 'o']
wd_flg = [True for _ in wd]

used = [0]
cur = wd[0]
if k != 1:
  for i, e in enumerate(wd):
    if e > cur + c:
      used.append(i)
      cur = e
      if len(used) == k:
        break
        
used_rev = [len(wd)-1]
cur = wd[-1]
if k != 1: 
  for i, e in enumerate(wd[::-1]):
    if e < cur - c:
      used_rev.append(len(wd) - 1 - i)
      cur = e
      if len(used_rev) == k:
        break

for i in used:
  if i not in used_rev:
    continue
  if used.index(i) + used_rev.index(i) >= k:
    continue
  else:
    print(wd[i]+1)


### FIXED CODE ###

a, b, c = input().split()
print(c, a, b)
# coding: utf-8


# R: Right hand side
# L: Left  hand side
def add_stone(stone, pos, searched_stones):
    sample = searched_stones[::[1, -1][pos == "R"]]
    if sample[0] == stone:
        return None

    for n, s in enumerate(sample[1:]):
        if s == stone:
            return (stone * (n + 2) + sample[1 + n:])[::[1, -1][pos == "R"]]


def stones_bfs(searched_stones):
    
    queue = [[searched_stones, 0]]
    patterns = [["B", "R"], ["B", "L"], ["W", "R"], ["W", "L"]]
    
    while queue:
        stones = queue.pop(0)
        if (stones[0].count("W") == len(stones[0]) |
            stones[0].count("B") == len(stones[0])):
            return stones[-1]
            
        for p in patterns:
            s = add_stone(*p, stones[0])
            if s is not None:
                queue += [[s, stones[-1] + 1]]

print(stones_bfs(input().strip()))

### FIXED CODE ###

# coding: utf-8

stones = input().strip()
counter, switch = 0, stones[0]

for s in stones[1:]:
    if switch != s:
        switch = s
        counter += 1

print(counter)
import sys
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=0
c.sort()
e=-1
f=0
for i in range(a):
  d+=c[i]
  

for i in range(b):
  if b>=0:
    b-=1
    f+=1
      
    d-=c[e]
    e-=1
    if d<=0:
      print(f)
      sys.exit()

  
f+=c[e]
f+=c[e-1]

print(f-1)



### FIXED CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()

if N - K < 0:
  print(0)
else:
  print(sum(H[:N-K]))
def min(a,i):
  for t in range(0, i):
    if a[0] > a[t]:
      a[0] = a[t]
  return a[0]

def max(a,i):
  for t in range(0, i):
    if a[0] < a[t]:
      a[0] = a[t]
  return a[0]

def sum(a,i):
  for t in range(1, i):
    a[0] += a[t]
  return a[0]

i = int(raw_input())
a = map(int, raw_input().split())
print "%d %d %d" % min(a,i) max(a,i) sum(a,i)

### FIXED CODE ###

def min(a,i):
  x = a[0]
  for t in range(0, i):
    if x > a[t]:
      x = a[t]
  return x

def max(a,i):
  y = a[0]
  for t in range(0, i):
    if y < a[t]:
      y = a[t]
  return y

def sum(a,i):
  s = 0
  for t in range(0, i):
    s += a[t]
  return s

i = int(raw_input())
a = map(int, raw_input().split())
print "%d %d %d" % (min(a,i), max(a,i), sum(a,i))
n,s = map(int, input().split())

for x in range(n):
    for y in range(n):
        tmp = n-x-y
        tmp2 = s-x*10000-y*5000
        if tmp*1000 == tmp2 and tmp >= 0:
            print(f'{x} {y} {tmp}')
            exit(0)

print('-1 -1 -1')

### FIXED CODE ###

n,s = map(int, input().split())

for x in range(n+1):
    for y in range(n+1-x):
        tmp = n-x-y
        if (x*10000+y*5000+tmp*1000) == s:
            print('{} {} {}'.format(x,y,tmp))
            exit(0)

print('-1 -1 -1')
import math
p=math.pi
r=(int. inport())
print("{0:.5f} {1:.5f}".format(p*r*r,2*p*r)

### FIXED CODE ###

from math import pi
r=float(input())
print("{0:.5f} {1:.5f}".format(pi*r*r, 2*pi*r))
n = int(input())
t,a = map(int,input().split())
hl = list (map(intinput().split()))

dt = 10**9
num = 0
for i in range(n):
  ti = t = hl[i]*0.006
  if abs(a - ti) <= dt:
    dt = abs(a -ti)
    num = i
    
    
print(num + 1)

### FIXED CODE ###

n = int(input())
t, a = map(int, input().split())
hl = list(map(int, input().split()))

dt = 10**9
num = 0
for i in range(n):
    ti = t - hl[i] * 0.006
    if abs(a - ti) <= dt:
        dt = abs(a - ti)
        num = i

print(num + 1)
n = int(input())
a = map(int, input().split())
import numpy as np
npa = np.array(a)
print(1/(sum(1/a))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
import numpy as np
npa = np.array(a)
print(1/(sum(1/npa)))
l = [0 for i in range(20)]
pos = goal = 0
def solve(cur,sum):
    global pos, goal
    if cur == goal:
        print " ".join(map(str,l[:pos]))
        return
    for i in range(sum,0,-1):
        if cur + i <= goal:
            l[pos] = i
            pos += 1
            solve(cur+i,i)
            pos -= 1
while True:
    goal = int(raw_input())
    if goal==0: break
    solve(0,goal)

### FIXED CODE ###

l = [0]*31
pos = goal = 0
def solve(sum,cur):
    global pos, goal
    if sum == goal:
        print " ".join(map(str,l[:pos]))
        return
    for i in range(cur,0,-1):
        if sum + i <= goal:
            l[pos] = i
            pos += 1
            solve(sum+i,i)
            pos -= 1
while True:
    goal = int(raw_input())
    if goal == 0: break
    solve(0,goal)
D = int(input())
T = int(input())
S = int(input())

travel_time = D * S
if travel_time <= T:
  print "yes"
  else: print "no"
  

### FIXED CODE ###

d,s,t = map(int,input().split())
print('Yes' if d/s <= t else 'No')
N,M=map(int,input().split())

A=list(map(int,input().split()))
A.sort()
dc=[]

for i in range(M):
    B,C=map(int,input().split())
    dc.append([B,C])

dc.sort(key=lambda x: x[1],reverse=True)
bf=False
i=0

for l in dc:
    B,C=l
    if bf:
        break
    while B>0:
        if A[i]<C and i<N:
            A[i]=C
            B-=1
            i+=1
        else:
            bf=True
            i+=1
            break

print(sum(A))


### FIXED CODE ###

N,M=map(int,input().split())

A=list(map(int,input().split()))
A.sort()
dc=[]

for i in range(M):
    B,C=map(int,input().split())
    dc.append([B,C])

dc.sort(key=lambda x: x[1],reverse=True)
bf=False
i=0
for l in dc:
    B,C=l
    if bf:
        break
    while B>0:
        if i<N and A[i]<C:
            A[i]=C
            B-=1
            i+=1
        else:
            bf=True
            break


print(sum(A))
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = [0]*(N+1)
x = 0
for i in range(1,N+2):
  D[i] = D[i-1]+L[i-1]
while D[x] <= X:
  x += 1
print(x)

### FIXED CODE ###

N,X = map(int,input().split())
L = list(map(int,input().split()))
D = [0]*(N+1)
x = 0
for i in range(1,N+1):
  D[i] = D[i-1]+L[i-1]
for i in D:
  if i <= X:
    x += 1
print(x)
a,b,c = int(input())

if a <=c and b >= c:
  	print("Yes")
else:
  	print("No")

### FIXED CODE ###

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

if a <=c and b >= c:
  	print("Yes")
else:
  	print("No")
a = [int(i) for i in input().join(' ')]
N = a[0]
M = a[1]

items = [int(i) for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N,M = [int(i) for i in input().split()]

items = [int(i) for i in input().split()]
items.sort(reverse=True)
total = sum(items)

flag = 1
for i in range(M):
  if total / (4 * M) <= items[i]:
    pass
  else:
    flag = 0
if flag:
  print('Yes')
else:
  print('No')
a=int(input())
b=list(map(int,input().split()))
i=0
c="YES"   ##ここ文字列だからくおーてーしょんいるの注意
for i in range(a-1):
 j=i+1
 for j in range (a-1):
    if b[i]==b[j]:
    c="NO" ##ここも
print(c)

### FIXED CODE ###

a,b=input().split()
A,B=map(int,input().split())
c=input()
if a==c:
  A=A-1
else:
  B=B-1
print(A,B)
n,q = (int(num) for num in input().split())
neighbor = [[] for _ in range(n)]
visited = [0] * n
val = [0] * n
ab = []
for i in range(n-1):
    a,b = (int(num)-1 for num in input().split())
    ab.append((a,b))

    
for item in ab:
    a = item[0]
    b = item[1]
    neighbor[a].append(b)
    neighbor[b].append(a)
    
        
#print(par)
#print(neighbor)
#print(rank)

for _ in range(q):
    p,x = (int(num) for num in input().split())
    p -= 1
    val[p] += x
    
def calc(idx,neighbor,val,bias):
    val[idx] += bias
    for i in neighbor[idx]:
        if visited[i] == 0:
            visited[i] = 1
            calc(i,neighbor,val,val[idx])

visited[0] = 1
calc(0,neighbor,val,0)    
ans = ""    
for num in val:
    ans += str(num) + " "
print(ans)




### FIXED CODE ###

n,q = (int(num) for num in input().split())
par = [n] * n
visited = [0] * n
val = [0] * n
ab = []
for i in range(n-1):
    a,b = (int(num)-1 for num in input().split())
    par[b] = a
    
for _ in range(q):
    p,x = (int(num) for num in input().split())
    p -= 1
    val[p] += x

for i in range(1,n):
    val[i] += val[par[i]]
    
ans = ""
for num in val:
    ans += str(num) + " "
print(ans)
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]
lin = [int(stdin.readline().rstrip()) for _ in range(m)]

for i in range(len(lin)-1):
    if lin[i] + 1 == lin[i+1]:
        print(0)
        exit()

dp = [-1 for _ in range(n+1)]
dp[0] = 1
if lin[0] == 1:
    dp[1] = 0
else:
    dp[1] = 1
for i in range(2,n+1):
    if i in lin:
        dp[i] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%(10**9+7))

### FIXED CODE ###

from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

lin = [0]*(n+1)

if m != 0:
    for i in range(m):
        lin[int(stdin.readline().rstrip())] = -1

dp = [-1]*(n+1)

dp[0] = 1

if lin[1] == -1:
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2,n+1):
    if lin[i] == -1:
        dp[i] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%(10**9+7))
import itertools
import numpy as np
import copy
h, w, k = map(int, input().split())
f = [list(input()) for i in range(h)]
f = np.array(f)
ans = 0
for i in range(w+1):
    for j in range(h+1):
        for p in itertools.combinations(range(w), i):
            for q in itertools.combinations(range(h), j):
                g = f.copy()
                cnt = 0
                for r in q:
                    g[r] = 'r'
                for r in p:
                    g.T[r] = 'r'
                
                for s in range(w):
                    for t in range(h):
                        if g[t][s] == '#':
                            cnt +=1
                if cnt == k:
                    ans += 1
print(ans)

### FIXED CODE ###

h, w, k = map(int, input().split())
C = [list(input()) for i in range(h)]
ans = 0
for i in range(1<<h):
    for j in range(1<<w):
        cnt = 0
        for x in range(h):
            if (i>>x)&1 == 1:
                continue
            for y in range(w):
                if (j>>y)&1 == 1:
                    continue
                if C[x][y] == '#':
                    cnt += 1
        if cnt == k:
            ans += 1
print(ans)
MOD = 10**9+7
N, M = [int(x) for x in input().split()]
if (M != 0):
    a_list = [int(input()) for _ in range(M)]
dp = [0] * (N+1)
dp[0] = 1
dp[1] = int(not (1 in a_list))
for i in range(2, N+1):
    if (i not in a_list):
        dp[i] = (dp[i-1] + dp[i-2]) % MOD
print(dp[N])


### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(10**7)
lst = dict({0: 1, 1: 1, 2: 2})
def calc(n):
    if (n in lst):
        return lst[n]
    else:
        lst[n] = calc(n-1) + calc(n-2)
        return lst[n]

N, M = [int(x) for x in input().split()]
if (M != 0):
    a_list = [int(input()) for _ in range(M)]
    span_list = [a_list[0]-1]
    for i, a in enumerate(a_list[:-1]):
        if (a_list[i+1] - a) == 1:
            print(0)
            exit()
        else:
            span_list.append(a_list[i+1] - 2 - a)
    span_list.append(N - a_list[-1] -1)
else:
    span_list = [N]
max_span = max(span_list)
for i in range(max_span+1):
    calc(i)
ans = 1
for span in span_list:
    ans = (ans * lst[span]) % (10**9+7)
print(ans)
H, W, K = map(int, input().split())

S = []
for _ in range(H):
    S.append(input())

ans = H * W

for c in range(2**(H-1)):
    num_lines = 0

    g = {}
    tmp = c
    g_index = 0
    for h in range(H):
        g[h] = g_index 
        num_groups = g_index 
        if tmp % 2 == 1:
            g_index += 1
        tmp //= 2

    num_groups += 1

    num_lines = num_groups - 1 

    g_sum = [0] * num_groups

    for w in range(W):
        tmp = g_sum.copy()

        ok = True
        ok2 = True
        for h in range(H):
            tmp[g[h]] += int(S[h][w])
        
            if tmp[g[h]] > K :
                # modoru
                ok = False
                if g_sum[g[h]] == 0:
                    ok2 = False

        if ok :
            g_sum = tmp
        else:
            if ok2:
                g_sum = [tmp[gi] - g_sum[gi] for gi in range(num_groups)]
                num_lines += 1
            else:
                break

    if not ok2:
        continue

    if ans > num_lines:
        ans = num_lines


print(ans)

### FIXED CODE ###

H, W, K = map(int, input().split())

S = []
for _ in range(H):
    S.append(input())

ans = H * W

for c in range(2**(H-1)):
    num_lines = 0

    g = {}
    tmp = c
    g_index = 0
    for h in range(H):
        g[h] = g_index 
        num_groups = g_index 
        if tmp % 2 == 1:
            g_index += 1
        tmp //= 2

    num_groups += 1

    num_lines = num_groups - 1 

    g_sum = [0] * num_groups

    for w in range(W):
        tmp = g_sum[:]

        ok = True
        ok2 = True
        for h in range(H):
            tmp[g[h]] += int(S[h][w])
        
            if tmp[g[h]] > K :
                # modoru
                ok = False
                if g_sum[g[h]] == 0:
                    ok2 = False

        if ok :
            g_sum = tmp
        else:
            if ok2:
                g_sum = [tmp[gi] - g_sum[gi] for gi in range(num_groups)]
                num_lines += 1
            else:
                break

    if not ok2:
        continue

    if ans > num_lines:
        ans = num_lines


print(ans)
a, b, c, d = map(int, input().split())
x = sorted(a, b)
y = sorted(c, b)

if (x[-1] - x[0]) <= d and (y[-1] - y[0]) <= d:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

a, b, c, d = map(int, input().split())
x = sorted([a, b])
y = sorted([c, b])

if (max(a, c) - min(a, c)) <= d:
    print("Yes")
elif (x[-1] - x[0]) <= d and (y[-1] - y[0]) <= d:
    print("Yes")
else:
    print("No")
n, k = map(int, input().split())

a = 1
for i in range(k, n + 1):
  mmin = summ(i - 1)
  mmax = summ(n, n - i)
  m = mmax - mmin + 1
  a += m

  k = 10**9 + 7
  print(int(a%k))

    
def summ(n, nn=0):
  nn = max(nn, 0)
  return n*(n+1)/2 - nn*(nn+1)/2


### FIXED CODE ###

def summ(n, nn=0):
  nn = max(nn, 0)
  return n*(n+1)/2 - nn*(nn+1)/2

n, k = map(int, input().split())

a = 1
for i in range(k, n + 1):
  mmin = summ(i - 1)
  mmax = summ(n, n - i)
  m = mmax - mmin + 1
  a += m

k = 10**9 + 7
print(int(a%k))
n = int(input)
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)
  

### FIXED CODE ###

n = int(input())
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)
b = input()
a =int(b)
m = len(b)
for i in reversed(range(1,int(math.sqrt(a))+1)):
    if a/i == int(a/i):
        m = max(len(str(a//i)),len(str(i)))
        break
print(m)

### FIXED CODE ###

import math
b = input()
a =int(b)
m = len(b)
for i in reversed(range(1,int(math.sqrt(a))+1)):
    if a/i == int(a/i):
        m = max(len(str(a//i)),len(str(i)))
        break
print(m)
N = int(input())
ll = map(int,input())
 
print(max(ll)-min(ll))

### FIXED CODE ###

N = int(input())
ll = list(map(int,input().split()))
 

print(max(ll)-min(ll))
n = int(input())
s = input()
count = 0

for i in range(n-1):
    if s[i] == "A":
        if s[i+1] == "B":
            if s[i+2] == "C":
                count += 1
print(count)

### FIXED CODE ###

n = int(input())
s = input()
count = 0

for i in range(n-2):
    #print(s[i],s[i+1],s[i+2])
    if s[i] == "A":
        if s[i+1] == "B":
            if s[i+2] == "C":
                count += 1
print(count)
a=input()
b=input()
a=int(a)
b=int(b)
print(a*b,(a+b)*2)


### FIXED CODE ###

a=input().split()
b=int(a[1])
a=int(a[0])
print(a*b,(a+b)*2)
from queue import Queue
import sys

sys.setrecursionlimit(10 ** 6)

def main():
  n, m = map(int, input().split())

  edges = [[] for _ in range(m)]

  for _ in range(m):
    a, b = map(lambda x: int(x) - 1, input().split())
    edges[a].append(b)
    edges[b].append(a)

  visited = {0: -1}

  q = Queue()
  q.put(0)

  while not q.empty():
    current = q.get()
    for nxt in edges[current]:
      if nxt not in visited:
        visited[nxt] = current
        q.put(nxt)

  if len(visited) == n:
    print("Yes")
    for i in range(1, n):
      print(visited[i] + 1)
  else:
    print("No")


main()


### FIXED CODE ###

from queue import Queue
import sys

sys.setrecursionlimit(10 ** 6)

def main():
  n, m = map(int, input().split())

  edges = [[] for _ in range(n)]

  for _ in range(m):
    a, b = map(lambda x: int(x) - 1, input().split())
    edges[a].append(b)
    edges[b].append(a)

  visited = {0: -1}

  q = Queue()
  q.put(0)

  while not q.empty():
    current = q.get()
    for nxt in edges[current]:
      if nxt not in visited:
        visited[nxt] = current
        q.put(nxt)

  if len(visited) == n:
    print("Yes")
    for i in range(1, n):
      print(visited[i] + 1)
  else:
    print("No")


main()
h, w = (int(i) for i in input().split())
list_a = [input() for s in range(0, w)]
list_tmp = []
for i in range(0, w):
    for j in range(0, h):
        if list_a[i][j] == '#':
            list_tmp.append(list(list_a[i]))
            break
# 転置... https://note.nkmk.me/python-list-transpose/　参照
list_tmp_t = [list(x) for x in zip(*list_tmp)]
list_tmp2 = []
for i in range(0, h):
    for j in range(0, len(list_tmp_t[i])):
        if list_tmp_t[i][j] == '#':
            list_tmp2.append(list(list_tmp_t[i]))
            break
# 転置... https://note.nkmk.me/python-list-transpose/　参照
list_ans = [list(x) for x in zip(*list_tmp2)]
for i in range(0, len(list_ans)):
    print("".join(list_ans[i]))

### FIXED CODE ###

h, w = (int(i) for i in input().split())
list_a = [input() for s in range(0, h)]
list_tmp = []
for i in range(0, h):
    for j in range(0, w):
        if list_a[i][j] == '#':
            list_tmp.append(list(list_a[i]))
            break
# 転置... https://note.nkmk.me/python-list-transpose/　参照
list_tmp_t = [list(x) for x in zip(*list_tmp)]
list_tmp2 = []
for i in range(0, len(list_tmp_t)):
    for j in range(0, len(list_tmp_t[i])):
        if list_tmp_t[i][j] == '#':
            list_tmp2.append(list(list_tmp_t[i]))
            break
# 転置... https://note.nkmk.me/python-list-transpose/　参照
list_ans = [list(x) for x in zip(*list_tmp2)]
for i in range(0, len(list_ans)):
    print("".join(list_ans[i]))
# coding: utf-8
from math import ceil
from statistics import median, mean
N = int(input())
A = list(map(int, input().split()))
A.sort()
if N % 2 == 0:
    m = ceil((A[N//2] + A[N//2+1]) / 2)
else:
    m = A[N//2]
ans = 0
for i in range(N):
    ans += (A[i] - m)**2
print(ans)

### FIXED CODE ###

# coding: utf-8
from math import ceil
from statistics import median, mean
N = int(input())
A = list(map(int, input().split()))
ans = 10**9
for m in range(-100, 101):
    tmp = 0
    for i in range(N):
        tmp += (A[i] - m)**2
    ans = min(ans, tmp)
print(ans)
A, B, C = int(input[])

int D = max(A, B, C)

if A == D :
  print(A * 10 + B + c)
  
elif B == D:
  print(B * 10 + A + C)
  
elif C == D
  print(C * 10 + A + B)

### FIXED CODE ###

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


ans = max(A*10 + B + C, B*10 + A + C, C*10 + A + B)
print(ans)