Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
A = list(map(int, input().split()))
ch = []
for _ in range(M):
    b, c = map(int, input().split())
    ch.append([c, b])

A.sort()
ch.sort(reverse = True)


n = -1
result = 0
fin = 0
for c, b in ch:
    if fin == 1:
        break

    n += b
    if c < A[n]:
        for i, j in enumerate(A[n-b+1:]):
            if c < j:
                result += c*i + sum(A[n-b+i+1:])
                fin += 1
                break
    else:
        result += b * c


if not fin == 1:
    result += sum(A[n+1:])



print(result)


### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
ch = []
for _ in range(M):
    b, c = map(int, input().split())
    ch.append([c, b])

A.sort()
ch.sort(reverse = True)


n = -1
result = 0
fin = 0
for c, b in ch:
    if fin == 1:
        break

    n += b

    if n >= N:
        for num in A[n-b+1:]:
            if c > num:
                result += c
            else:
                result += num
            fin += 1
        break

    if c < A[n]:
        for i, j in enumerate(A[n-b+1:]):
            if c < j:
                result += c*i + sum(A[n-b+i+1:])
                fin += 1
                break
    else:
        result += b * c


if not fin == 1:
    result += sum(A[n+1:])



print(result)
K = int(input())
A, B = list(map(int, input().split()))

for i in range(A, B+1):
  if i％K == 0:
    print("OK")
    end
print("NG")

### FIXED CODE ###

import sys
K = int(input())
A, B = list(map(int, input().split()))
 
for i in range(A, B+1):
  if i%K == 0:
    print("OK")
    sys.exit( )
print("NG")
X, K, D = [int(n) for n in input()]

#X = 10
#K = 1
#D = 2


startN = (D * K - X) // (2 * D)

N1 = startN + 1
N2 = startN
N3 = startN - 1

if N1 < 0:
    N1 = 0
if N2 < 0:
    N2 = 0
if N3 < 0:
    N3 = 0

def getScore(n):
    score = X + n * D - D * (K - n)
    if score < 0:
        score = score * -1
    return score

score1 = getScore(N1)
score2 = getScore(N2)
score3 = getScore(N3)

minScore = score1
if minScore > score2:
    minScore = score2
if minScore > score3:
    minScore = score3

print(minScore)

### FIXED CODE ###

X, K, D = [int(n) for n in input().split(" ")]

#X = 10
#K = 1
#D = 2


startN = (D * K - X) // (2 * D)

N1 = startN + 1
N2 = startN
N3 = startN - 1

if N1 < 0:
    N1 = 0
if N2 < 0:
    N2 = 0
if N3 < 0:
    N3 = 0
if N1 > K:
    N1 = K
if N2 > K:
    N2 = K
if N3 > K:
    N3 = K

def getScore(n):
    score = X + n * D - D * (K - n)
    if score < 0:
        score = score * -1
    return score

score1 = getScore(N1)
score2 = getScore(N2)
score3 = getScore(N3)

minScore = score1
if minScore > score2:
    minScore = score2
if minScore > score3:
    minScore = score3

print(minScore)
n = input()
n = dict(n)

l = [0,1,6,8]
if n[-1] == "3":
  print("bon")
elif str(n[-1]) in l:
  print("pon")
else:
  print("hon")

### FIXED CODE ###

n = input()
n = list(n)
l = [0,1,6,8]
if n[-1] == "3":
  print("bon")
elif int(n[-1]) in l:
  print("pon")
else:
  print("hon")
d, g = map(int, input().split())
p = []
c = []
for _ in range(d):
    _p, _c = map(int, input().split())
    p.append(_p)
    c.append(_c)

ans_list = []

def dfs(i, p, c, res, count):
    if i == 0:
        if res >= g:
            ans_list.append(count)
    else:
        for j in range(p[i - 1] + 1):
            _count = count + j
            _res = res + 100 * j * i
            if j == p[i - 1]:
                _res += c[i - 1]
            dfs(i - 1, p, c, _res, _count)

dfs(d, p, c, res, count)
print(min(ans_list))

### FIXED CODE ###

import numpy as np
d, g = map(int, input().split())
p = []
c = []
for _ in range(d):
    _p, _c = map(int, input().split())
    p.append(_p)
    c.append(_c)

s = np.arange(1, d + 1) * 100
p = np.array(p)

ans_list = []

bool_list = [False] * d

state_list = []

def dfs(i, n, bool_list):
    bool_list = bool_list.copy()
    if i == n:
        state_list.append(bool_list)
    else:
        dfs(i + 1, n, bool_list)
        bool_list[i] = True
        dfs(i + 1, n, bool_list)

dfs(0, d, bool_list)

for state in state_list:
    if np.dot(s * p, state) + np.dot(c, state) >= g:
        ans_list.append(np.dot(p, state))
    else:
        score = max(s * np.array([not i for i in state]))
        for j in range(1, p[score//100 - 1] + 1):
            if np.dot(s * p, state) + np.dot(c, state) + score * j >= g:
                ans_list.append(np.dot(p, state) + j)

print(min(ans_list))
a, b, c = [int(i) for i in input().split()]
if(max(a,b,c)*2 == sum(a,b,c)):
 print("Yes")
else:
 print("No")

### FIXED CODE ###

a, b, c = [int(i) for i in input().split()]
if(max([a,b,c])*2 == sum([a,b,c])):
 print("Yes")
else:
 print("No")
s = input()
t = input()
flag=0
if s in t:
  if(len(t)-len(s)=1 and s[0]==t[0]):
    flag=1
print("Yes") if(flag) else print("No")

### FIXED CODE ###

s = input()
t = input()
flag=0
if s in t:
  if(len(t)-len(s)==1 and s[0]==t[0]):
    flag=1
print("Yes") if(flag) else print("No")
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
b.reverse()
p = 1
c = 0
d = 0
for i in range(n):
    if a[i] == b[i]:
        v = a[i]
        h = i
        p = 0
        break
if p == 1:
    print('Yes')
    for i in range(n):
        print(b[i],end = ' ')
else:
    for i in range(n):
        if a[i] != v and b[i] != v:
            c += 1
        if b[i] == a[i] :
            d += 1
    if c < d:
        print('No')
    else:
        print('Yes')
        o = 0
        for i in range(n):
            if a[i] != v and b[i] != v:
                b[i],b[h+o] = b[i+h],b[i]
                o += 1
                if o == d:
                    break
        for i in range(n):
            print(b[i],end = ' ')

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
b.reverse()
p = 1
c = 0
d = 0
for i in range(n):
    if a[i] == b[i]:
        v = a[i]
        h = i
        p = 0
        break
if p == 1:
    print('Yes')
    for i in range(n):
        print(b[i],end = ' ')
else:
    for i in range(n):
        if a[i] != v and b[i] != v:
            c += 1
        if b[i] == a[i] :
            d += 1
    if c < d:
        print('No')
    else:
        print('Yes')
        o = 0
        for i in range(n):
            if a[i] != v and b[i] != v:
                b[i],b[h+o] = b[o+h],b[i]
                o += 1
                if o == d:
                    break
        for i in range(n):
            print(b[i],end = ' ')
num = int(input())
flag = True
for x in range(2,10):
  if num % x == 0:
    print("YES")
	flag = False
if flag:
  print("NO")


### FIXED CODE ###

num = int(input())
Flag = False
for x in range(1,10):
  for y in range(x,10):
    if x * y == num:
      Flag = True
      break
    if Flag == True:
      break

if Flag:
  print("Yes")
else:
  print("No")
n, X = map(int,input().split())
x = sorted(list(map(int, input().split())) + [X])

xx = [x[i+1] -x[i] for i in range(len(x)-1)]

import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print(gcd_list(xx))


### FIXED CODE ###

import sys

def gcd(a,b):
    mod = a % b
    if mod == 0:
        return b
    return gcd(b, a%b)


n, X = map(int,input().split())
x = sorted(list(map(int, input().split())) + [X])

if len(x) == 2:
    print(x[1]- x[0])
    sys.exit()

xx = [x[i+1] -x[i] for i in range(len(x)-1)]

g = gcd(xx[0],xx[1])

if len(xx) >= 3:
    for i in range(2,n):
        g = gcd(g,xx[i])

print(g)
a, b = map(float, input().split())
b = b*1000
c = a*b
print(math.floor(c/1000))

### FIXED CODE ###

a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)
N,K=map(int,input().split())
A=[0]*N
for i in range(N):
    A[i]=int(input())

A=sorted(A)
t=10**9
for i in range(K):
    t=min(t,abs(A[K-1+i]-A[i]))
print(t)

### FIXED CODE ###

N,K=map(int,input().split())
A=[0]*N
for i in range(N):
    A[i]=int(input())

A=sorted(A)
t=10**9
for i in range(N-K+1):
    t=min(t,abs(A[K-1+i]-A[i]))
print(t)
import math

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

G = math.gcd(A, B)
ans = 1

for i in range(G-1):
    if (G < i):
        break
    if(G % (i+2) == 0):
        ans += 1
        j = 1
        while(G % ((i+2)**j) == 0):
            G /= i+2
            j += 1

print(ans)



### FIXED CODE ###

import fractions
from math import sqrt

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

G = fractions.gcd(A, B)
N = int(sqrt(max(A,B)))+1
g = G
ans = 1

for i in range(2, N+3):
    if(g % i == 0):
        ans += 1
        while(g % i == 0):
            g = g/i
            
if g != 1:
    ans += 1

print(ans)
1 #!/usr/bin/env python3
  2 # -*- coding: UTF-8 -*-
  3 n=int(input())
  4 l,r=[],[]
  5 for i in range(n):
  6     x,y=map(int,input().split())
  7     l.append((x,y))
  8 l.sort()
  9 for i in range(n):
 10     x,y=map(int,input().split())
 11     r.append((x,y))
 12 r.sort()
 13 ans=[0]*n
 14 t=-1
 15 for i,j in l:
 16     t+=1
 17     for x,y in r:
 18         if i<x and j<y:
 19             ans[t]+=1
 20         else:
 21             break
 22 chk=0
 23 for i in ans:
 24     if i-chk>0: chk+=1
 25 print(chk)


### FIXED CODE ###

n=int(input())
l,r=[],[]
for i in range(n):
    x,y=map(int,input().split())
    l.append((x,y))
l.sort()
l.sort(key=lambda a: a[1],reverse=True)
for i in range(n):
    x,y=map(int,input().split())
    r.append((x,y))
r.sort()
ans=0
chk=[1]*n
for i in range(n):
    for j in range(n):
        if l[i][0]<r[j][0] and l[i][1]<r[j][1] and chk[j]:
            chk[j]=0
            ans+=1
            break
print(ans)
N=int(input())
S=list(input())
if S[0] == S[1]:
  S[0]==" "
for i in range(2,N):
  if S[i-1]==S[i]:
    S[i-1]=" "
A=[]
for i in range(N):
      if S[i]!=" ":
            A.append(S[i])
print(len(A))


### FIXED CODE ###

N=int(input())
S=list(input())
if N == 1:
  print(1)
if N>=2:
  if S[0] == S[1]:
    S[0]==" "
  for i in range(1,N):
    if S[i-1]==S[i]:
      S[i-1]=" "
  A=[]
  for i in range(N):
        if S[i]!=" ":
              A.append(S[i])
  print(len(A))
n = int(input())
print(sum(list(range(n))))

### FIXED CODE ###

n = int(input())
print((n-1 + 1) * (n-1) // 2)
from collections import deque


def p_e():
    n, k = map(int, input().split())
    *a, = map(int, input().split())
    s = [0] * (n + 1)
    for i in range(n):
        s[i + 1] = (s[i] + a[i] - 1) % k
    mp = [0] * k
    q = deque()
    ans = 0
    for i in range(n + 1):
        ans += mp[s[i]]
        mp[s[i]] += 1
        q.append(s[i])
        if len(q) == k:
            mp[q.popleft()] -= 1
    print(ans)
    
p_e()

### FIXED CODE ###


from collections import deque
from collections import defaultdict


def p_e():
    n, k = map(int, input().split())
    a = [0] + list(map(int, input().split()))
    for i in range(n):
        a[i + 1] = (a[i + 1] + a[i] - 1) % k
    d = defaultdict(int)
    d[0] = 1
    q = deque()
    ans = 0
    for i in range(1, n + 1):
        if i - k >= 0:
            d[a[i - k]] -= 1
        ans += d[a[i]]
        d[a[i]] += 1
    print(ans)
    
p_e()
import math
x, y = map(int, input().split())
a = math.gcd(x, y)
print(int(x*y/a))

### FIXED CODE ###

import fractions
x, y = map(int, input().split())
a = fractions.gcd(x, y)
b = int(x*y/a)
print(b)
A, B, X = map(int, input().split())

if X - A > = 0 and A + B >= X:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

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

if X - A >= 0 and A + B >= X:
    print("YES")
else:
    print("NO")
import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

import numpy as np

n = ni()
a = na()
x = n//2

dp = [[a[i]]*(x+1) for i in range(n)]

se = [2,3,4]

for i in range(n):
    for j in range(2,x+1):
        a = -100000000000
        for k in se:
            p = i-k
            if p >= 0:
                a = max(a,dp[p][j-1])
        dp[i][j] += a

print(dp[n-1][x])

### FIXED CODE ###

import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = na()

dp = [0]*n
b = a[0]

dp[1] = max(a[0],a[1])

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

print(dp[-1])
n=int(input())
X=[]
for i in range(n):
    s,p=input().split()
    X.append((s,100-int(p),i+1))
X=sorted(X,key=lambda x:(x[0],x[1]))
for i in range(n):
    print(X[i][2])


### FIXED CODE ###

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

p += a*3
ans = int(p/2)
print(ans)
S = input()
list1 = list(S)

list2 = [0 for i in range(len(list1))]

t = 0 #現在地
coutR = 0
coutL = 0
RLsindex = 0

def countLnum(t,coutL):
        if t+2 >= len(list1):
                return int(coutL)
        elif list1[t+2] == "R" :
                return int(coutL)
        else:
                coutL = countLnum(t+1,coutL+1)
                return coutL


def RLstart(t,coutL):
        list2[t] +=1
        list2[t+1] +=1 #RL部分の初期値はそのままループし続ける
        if coutR %2 ==0:
                list2[t] += int(coutR/2)
                list2[t+1] += int(coutR/2)
        else:
                list2[t] += int(coutR/2 -0.5)
                list2[t+1] += int(coutR/2 +0.5)
        if coutL %2 == 0 :
                list2[t] += int(coutL/2)
                list2[t+1] += int(coutL/2)
        else:
                list2[t] += int(coutL/2 +0.5)
                list2[t+1] += int(coutL/2 -0.5)


while t < len(list1):
        if list1[t] == "R":
                if list1[t+1] == "R":
                        coutR += 1
                        t += 1
                elif list1[t+1] == "L":
                        coutL = countLnum(t,0)
                        RLstart(t,coutL)
                        t+=2 + coutL
                        coutR,coutL = 0,0
s = ""
for i in range(len(list2)):
        s += str(list2[i]) + " "
print(s)

### FIXED CODE ###

s = input()

import sys
sys.setrecursionlimit(1000000)
list1 = [0]*len(s)


def r_search(start,index,count):
    if s[index] == "L":
        count -= 1 #RLで計算が始まる為
        if count == 0: #LRLの要な場合
            list1[index-1] += 1
            list1[index] += 1
            return index+1
        elif count %2 != 0: #奇数
            list1[index-1] += count//2 + 1 #このへんの+1は元々のRLの分
            list1[index] += count//2 +1 + 1
            return index+1
        else: #偶数
            list1[index-1] += count//2 + 1
            list1[index] += count//2 + 1
            return index+1
    else:
        return r_search(start,index+1,count+1)
        



def l_search(start,index,count): #start-1がL,-2がRで有ることが決まっている
    if index >= len(s) or s[index] == "R":
        if count %2 != 0: #奇数の場合逆側に１多く入る
            list1[start-2] += count//2+1
            list1[start-1] += count//2
            return index
        else:
            list1[start-2] += count//2
            list1[start-1] += count//2
            return index

    else:
        return l_search(start,index+1,count+1)
i = 0
while True:
    if i >= len(s):
        break
    elif s[i] == "R":
        i = r_search(i,i,0)
    else:
        i = l_search(i,i,0)
print(" ".join(map(str,list1)))
#人が一人しかいないとき
if N == 1:
    print(1)
    exit()

#人が2人以上いるとき
l = [0,1]
H = []
#N人それぞれが正直か不誠実かの全パターンを生成
for i in range(2**N+1):
    S = str(bin(i)).zfill(N)
    H.append(S[2:].zfill(N))
#入力を受け取る
IXY = []
for i in range(1,N+1):
    t = int(input())
    for j in range(t):
        x,y = map(int,input().split())
        #i番目の人が「x番目の人はyである」と証言
        IXY.append([i,x,y])

ANS = []
for h in H:
    flg = True
    for ixy in IXY:
        i,x,y = ixy[0]-1,ixy[1]-1,ixy[2]
        if h[i] == "1" and h[x] != str(y):
            flg = False
            break
    if flg:ANS.append(h)

ans = 0
for a in ANS:
    ans = max(a.count("1"),ans)
print(ans)

### FIXED CODE ###

N = int(input())

#人が一人しかいないとき
if N == 1:
    print(1)
    exit()

#人が2人以上いるとき
#N人それぞれが正直か不誠実かの全パターンを生成
H = []
for i in range(2**N):
    S = str(bin(i))
    H.append(S[2:].zfill(N))
#入力を受け取る
IXY = []
for i in range(N):
    t = int(input())
    for j in range(t):
        x,y = map(int,input().split())
        #i番目の人が「x番目の人はyである」と証言
        IXY.append([i,x,y])

ans = 0
for h in H:
    cnt = h.count("1")
    for ixy in IXY:
        i,x,y = ixy[0],ixy[1]-1,ixy[2]
        if h[i] == "1" and h[x] != str(y):
            cnt = 0
            break
    ans = max(ans,cnt)
print(ans)
n,m=map(int,input().split())
s=[[]for i in range(n+1)]
t=[1]*(n+1)
p=0
for i in range(m):
    a,b=map(int,input().split())
    if i==0:
        k=[a,b]
        t[a],t[b]=0,0
    else:
        if a==k[0] and t[b]==1:
            k=[b]+k
        elif b==k[0] and t[a]==1:
            k=[a]+k
        elif a==k[1] and t[b]==1:
            k.append(b)
        elif b==k[1] and t[a]==1:
            k.append(a)
        else:
            s[a].append(b)
            s[b].append(a)
p=len(k)
while p!=n:
    for i in s[k[-1]]:
        if t[i]:
            t[i]=0
            k.append(i)
            p+=1
            break
    else:
        c=1
    for i in s[k[0]]:
        if t[i]:
            t[i]=0
            k=[i]+k
            p+=1
            break
    else:
        c+=1
        if c==2:
            break
print(p)
print(*k)

### FIXED CODE ###

n,m=map(int,input().split())
s=[[]for i in range(n+1)]
t=[1]*(n+1)
for i in range(m):
    a,b=map(int,input().split())
    s[a].append(b)
    s[b].append(a)
a,b=[],[]
p=1
t[1]=0
while 1:
    for i in s[p]:
        if t[i]:
            t[i]=0
            p=i
            a.append(i)
            break
    else:
        break
p=1
while 1:
    for i in s[p]:
        if t[i]:
            t[i]=0
            p=i
            b.append(i)
            break
    else:
        break
print(1+len(a)+len(b))
t=a[::-1]+[1]+b
print(*t)
N = int(input())
p = list(map(int, input().split()))
plen = len(p)

count = 0

for i in range(plen):
    if p[i] == N - 1:
        p[i - 1], p[i] = p[i], p[i - 1]
        count += 1
    elif p[i] == i + 1:
        p[i], p[i + 1] = p[i + 1], p[i]
        count += 1
            
print(count)


### FIXED CODE ###

N = int(input())
p = list(map(int, input().split()))
plen = len(p)

count = 0

for i in range(plen):
    if p[i] == i + 1:
        if p[i] == N:
            p[i - 1], p[i] = p[i], p[i - 1]
        else:
            p[i], p[i + 1] = p[i + 1], p[i]
        count += 1
    
            
print(count)
def main():
  n = int(input())

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

	ans = 1

  for x in l:
    ans = ans*x
    if(ans > 1000000000000000000):
      print(-1)
      return


  print(ans)

main()

### FIXED CODE ###

def main():
    n = int(input())
    l = list(map(int, input().split()))
    ans = 1
    
    if 0 in l:
      print(0)
      return
 
    for x in l:
        ans = ans*x
        if(ans > 1000000000000000000):
            print(-1)
            return
    print(ans)
 
main()
def main()->None:
    W, H, N = map(int, input().split())
    range_N = range(N)
    xl, xr, yd, yu = 0, w, 0, h
    for i in range_N:
        x, y, a = map(int, input().split()
        if a == 1:
            xl = max(x, xl)
        if a == 2:
            xr = min(x, xr)
        if a == 3:
            yd = max(y, yd)
        else:
            yu = min(y, yu)
    if xl >= xr or yd >= yu:
        print(0)
    else:
        print((xr - xl) * (yu - yd))

if __name__ == "__main__":
    main()

### FIXED CODE ###




def main()->None:
    W, H, N = map(int, input().split())
    range_N = range(N)
    xl, xr, yd, yu = 0, W, 0, H
    for i in range_N:
        x, y, a = map(int, input().split())
        if a == 1:
            xl = max(x, xl)
        elif a == 2:
            xr = min(x, xr)
        elif a == 3:
            yd = max(y, yd)
        else:
            yu = min(y, yu)
    if xl >= xr or yd >= yu:
        print(0)
    else:
        print((xr - xl) * (yu - yd))

if __name__ == "__main__":
    main()
n, q = map(int, input().split())
tree = [list() for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    tree[a-1].append(b-1)
c = [0] * n
for i in range(q):
    p, x = map(int, input().split())
    subtree = tree[p-1].copy()
    c[p-1] += x

for i, subnode in enumerate(tree):
    for s in subnode:
        c[s] += c[i]

print(*c)


### FIXED CODE ###

n, q = map(int, input().split())
tree = [list() for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)
c = [0] * n
for i in range(q):
    p, x = map(int, input().split())
    c[p-1] += x

stack = [0]
j = [False] * n # すでに探索したか
while stack:
    node = stack.pop()
    j[node] = True
    for snode in tree[node]:
        if j[snode]:
            continue
        c[snode] += c[node]
        stack.append(snode)

print(*c)
#include <iostream>
using namespace std;

int main(){
    int a,b;
    cin >> a >> b;
    if(a*b % 2 == 0) cout << "Even\n";
    else cout << "Odd\n";
}

### FIXED CODE ###

a,b = map(int, input().split())
if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import pdb
import sys
F = sys.stdin
N, L = int(F.readline().rstrip().split())
a = [F.readline() for x in range(N)]

a.sort()
answer = ''.join(a)
print(answer)


### FIXED CODE ###

#! /usr/bin/env python
# -*- coding: utf-8 -*-

import pdb
import sys
F = sys.stdin
N, L = F.readline().rstrip().split()
N = int(N)
L = int(L)
a = [F.readline().rstrip() for x in range(N)]

a.sort()
answer = ''.join(a)
print(answer)
n_list=list(input().split())
a=int(n_list[0])
b=float(n_list[1])
ans=a*b
print(int(ans))

### FIXED CODE ###

N = int(input())
n_list = list(map(int,input().split()))
if 0 in n_list :
  print('0')
else:  
  ans = 1
  tho = 10**18
  for i in range (N):
    ans *= n_list[i]
    if ans > tho :
      print('-1')
      break
  if ans <= tho :
    print(ans)
N = int(input())
total = 0
tmp = 0
A = []
xy = []
l = []
for i in range(N):
  A.append(int(input())
  for j in range(A[i]):
    l.append(list(map(int,input().split())))
  xy.append(l)
  l.clear()
for i in range(2**N):
  flag = 1
  i = format(i, '0{}b'.format(N))
  for k in range(N):
    if i[k] == '1':
      tmp += 1
      for l in range(A[k]):
        if int(i[xy[k][l][0]]) != xy[k][l][1]:
          flag = 0
          break
      else:
        continue
      break
  if flag == 1 and total < tmp:
    total = tmp
  tmp = 0
print(total)
          


### FIXED CODE ###

#標準入力受け取り
N = int(input())
shougen = []
A_lis = []
for _ in range(N):
    A = int(input())
    A_lis.append(A)
    minishougen = []
    for j in range(A):
        xy = list(map(int, input().split()))
        minishougen.append(xy)
    shougen.append(minishougen)

#ビットの配列作る
bit_lis = []
for i in range(2 ** N):
    mini_bit_lis = []
    for j in range(N):
        mini_bit_lis.append(i % 2)
        i = i // 2
    bit_lis.append(mini_bit_lis)
    
#ビットの配列について全探索を行う
ans = 0
for i in range(2 ** N):
    flag = 0
    for l in range(N):
        if bit_lis[i][l] == 1:
            for k in range(A_lis[l]): 
                if shougen[l][k][1] != bit_lis[i][shougen[l][k][0] - 1]:
                    flag = 1
                    break
        if flag == 1:
            break
    if flag == 0:
        tmp = sum(bit_lis[i])
        if tmp > ans :
            ans = tmp
print(ans)
from itertools import accumulate
from decimal import Decimal
n,k=map(int,input().split())
p=list(map(int,input().split()))
l=[]
tmp=0
for i in range(n):
    p[i]=Decimal((p[i]+1)/2)
    tmp+=p[i]
    l.append(tmp)
ans=l[k]
for i in range(k,n):
    tmp=l[i]-l[i-k]
    if tmp>ans:
        ans=tmp
print(Decimal(ans))

### FIXED CODE ###

from itertools import accumulate
from decimal import Decimal
n,k=map(int,input().split())
p=list(map(int,input().split()))
l=[0]
tmp=0
for i in range(n):
    p[i]=Decimal((p[i]+1)/2)
    tmp+=p[i]
    l.append(tmp)
ans=0
for i in range(k,n+1):
    tmp=l[i]-l[i-k]
    if tmp>ans:
        ans=tmp
print(Decimal(ans))
n,m = map(int,input().split())
print(6-n-m)


### FIXED CODE ###

n =int(input())
m = int(input())
print(6-n-m)
k=input()
ans=[]
for i in range(k):
  ans.append("ACL")

print("".joint(ans))


### FIXED CODE ###

k = int(input())
ans=[]
for i in range(k):
  ans.append("ACL")

print("".join(ans))