peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
K = 0
for i in range(0,N-1):
    if A[i+1]-A[i]<0:
        K += A[i+1]-A[i]
    else:
        K += 0

print(K)
# Judge status: Wrong Answer
a, b, c = input().split()
x = [a, b, c]
x = sorted(x)
print(int((int(x[0])*int(x[1]))/2))
# Judge status: Accepted
N,A,B = map(int,input().split())
ans = 0
ans += (N//(A+B)) * A
i = min((N % (A+B)),A)
if i >= 0:
    ans += i
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
t = [0] * 8
p = 0

for i in range(n):
    if a[i] < 3200:
        t[a[i] // 400] = 1
    else:
        p += 1

x = t.count(1)
amax = p+x
if x == 0:
    amin = 1
else:
    amin = x
print(amin,amax)
# Judge status: Accepted
n=int(input())
for i in range(26):
    for j in range(100//7+1):
        if 4*i+7*j==n:
            print('Yes')
            import sys
            sys.exit()

print('No')
# Judge status: Accepted
s = input()

if s[0] == 'A' and s[2:-1].count('C') == 1 and all([ord('a') <= ord(c) <= ord('z') for c in s.replace('A', '').replace('C', '')]):
  print('AC')
else:
  print('WA')
# Judge status: Accepted
N = int(input())

xy = [map(int,input().split()) for _ in range(N)]
x,y = [list(i) for i in zip(*xy)]

ans = 0
flag = False

for i in range(N):
    if x[i] == y[i]:
        ans +=1
    elif ans >= 3:
        flag = True
        ans = 0
    else:
        ans = 0
        
if ans >= 3  or flag ==True:
    print("Yes")
    
else:
    print("No")
# Judge status: Wrong Answer
AC,WA,TLE,RE=0,0,0,0
for T in range(int(input())):
	S=input()
	if S=="AC":AC+=1
	elif S=="WA":WA+=1
	elif S=="TLE":TLE+=1
	else:RE+=1
	print("AC x", AC)
	print("WA x", WA)
	print("TLE x", TLE)
	print("RE x", RE)
# Judge status: Wrong Answer
s=input()
n=len(s)
ans=[]
for i in range(n-1):
    if s[i]!="B" and s[i+1]!="B":
        ans.append(s[i])
if s[-1]!="B":
    ans.append(s[-1])
print("".join(ans))
# Judge status: Accepted
n=int(input())
a=list(map(int, input().split()))
fumidai=fumidau=0
try:
    for i in range(len(a)):
        kijun=a[i]
        if kijun>a[i+1]:
            fumidau=kijun-a[i+1]
            fumidai+=fumidau
            a[i+1]=a[i+1]+fumidau

except:
    pass
print(fumidai)
# Judge status: Accepted
s = [int(input()) for i in range(4)]
x=0
a=0
b=0
c=0
for i in range(s[0]+1):
    for i in range(s[1]+1):
        for i in range(s[2]+1):
            if 500*a+100*b+50*c == s[3]:
                x=x+1
            c=c+1
        b=b+1
        c=0
    a=a+1
    b=0
    c=0
print(x)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))

cnt = 0

for X in range(min(A),max(A)):
    transient = A.count(X-1) + A.count(X) + A.count(X+1)
    if transient > cnt:
        cnt = transient

print(cnt)
# Judge status: Wrong Answer
def ord(n):
  if n % 2 == 1:
    return 0
  elif n % 4 == 0:
    return 2
  else:
    return 1

n = int(input())
a = list(map(lambda x:ord(int(x)),input().split()))
zero = a.count(0)
two = a.count(2)
if two>=zero:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a = int(input())
b = list(map(int,input().split()))
r=1
if 0 in b:
  r=0
else:  
  for i in b:
    r*=i
    if r>10**18:
      r=-1
      break
print(r)
# Judge status: Accepted
import math

N=int(input())
listA = list(map(int, input().strip().split()))
saisyou=listA[N]
saidai=listA[N]
i=N-1
k=0
count=1
kiroku = 1
listsum=0
while k<=N:
  listsum=listsum+listA[k]
  k=k+1

while i>=0:
  saisyou = math.ceil(saisyou/2)+listA[i]
  i=i-1
if(saisyou != 1):print(-1)
#print(saisyou)
if(saisyou == 1):
  i=0
  while i<N:
    listsum=listsum-listA[i]
    kiroku = min(2*(kiroku-listA[i]),listsum)
    count = count+kiroku
    i=i+1
  print(count)
# Judge status: Wrong Answer
import math

A, B, H, M = map(int, input().split(" "))

# print(A, B, H, M)

# 角度を求める.
angle_a = 30 * H + 0.5 * M

angle_b = M * 1.0

if angle_a == angle_b:
  angle = 0
elif angle_b > angle_a:
  angle = angle_b - angle_a
else:
  angle = angle_a - angle_b
# angle = abs(angle_a - amgle_b)

# print(angle)
  
# S = A * B * math.sin(math.radians(angle))

print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(angle))))
# Judge status: Wrong Answer
# ABC 138 C
N =int(input())
V = sorted([int(i) for i in input().split()])
ans = 0

for i,v in enumerate(V):
    if i<2:
        ans +=v/(2**(N-1))
    else:
        ans += v/(2**(i-1))
print(ans)
# Judge status: Wrong Answer
import math

n = str(input())

o = int(math.log10(int(n))//1)

if o == 0:
    print(n)
elif n[1:] == "9" * o:
    print(int(n[0]) + 9*o)
else:
    print(int(n[0]) - 1 + 9*o)
# Judge status: Accepted
K = int(input())
r = 7 % K
ans = -2
for i in range(K):
   if r == 0:
      ans = i
      break
   r = 10*r + 7
   r = r % K
print(ans+1)
# Judge status: Accepted
l=[list(map(int,input().split())) for i in range(3)]
x=l[0][0]
y=l[0][1]
z=l[0][2]
a=0
b=l[1][0]-x
c=l[2][0]-x
if b+y==l[1][1] and b+z==l[1][2] and c+y==l[2][1] and c+z==l[2][2]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
def cmbmod(n, r, k):
    #nCr mod kを求める（kは素数）
    p, q = 1, 1
    for i in range(r):
        p = p * (n-i) % k
        q = q * (r-i) % k
    return p * pow(q, k-2, k) % k

n, a, b = [int(_) for _ in input().split()]

const = 10**9 +7

ans = pow(2, n, const)
acmb = cmbmod(n, a, const)
bcmb = cmbmod(n, b, const)
ans = (ans-acmb-bcmb-1) %const

print(ans)
# Judge status: Accepted
smap, tmap = [-1] * 26, [-1] * 26

S = input()
T = input()

ans = 'Yes'
for s, t in zip(S, T):
    s = ord(s) - ord('a')
    t = ord(t) - ord('a')
    if smap[s] >= 0:
        if smap[s] != t:
            ans = 'No'
            break
    else:
        smap[s] = t
    if tmap[t] >= 0:
        if tmap[t] != s:
            ans = 'No'
            break
    else:
        tmap[t] = s
    
print(ans)
# Judge status: Accepted
N = int(input())
ans = 0
for j in range(1, N + 1):
    # ans+=j+2j+...(N//j)j
    n = N // j
    ans += j * n * (n + 1) // 2
print(ans)
# Judge status: Accepted
n, m = map(int,input().split())

if m - 2 * n >= 0:
    ans = n + (m-2*n)//4
    print(ans)
else:
    print(m//2)
# Judge status: Accepted
# 24
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
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 S(): return input()
def LS(): return input().split()


INF = float('inf')


n, k = LI()
d = set(LI())
# 最小金額から条件を満たすまで増やしていく
while True:
    if all(int(j) not in d for j in str(n)):  # 全ての桁の数字が d に属さない
        print(n)
        exit()
    n += 1
# Judge status: Wrong Answer
n = int(input())
s = 0
t = 0
for i in range(1, n):
  for j in range(1, int((n-i)**0.5)+1):
    if (n-1) % j == 0:
      s += 1
    if int((n-i)**0.5) == (n-i)**0.5:
      t += 1
print(s * 2 - t)
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())
dx=tx-sx
dy=ty-sy
ans=""
for i in range(dy):
    ans+="U"
for j in range(dx):
    ans+="R"
for i in range(dy):
    ans+="D"
for j in range(dx):
    ans+="L"
ans+="L"
for i in range(dy+1):
    ans+="U"
for i in range(dx+1):
    ans+="R"
ans+="DR"
for i in range(dy+1):
    ans+="D"
for i in range(dx+1):
    ans+="L"
ans+="U"
print(ans)
# Judge status: Accepted
H, N = map(int, input().split())

A = []
B = []

for n in range(N):
  a, b = map(int, input().split())
  A.append(a)
  B.append(b)
  
INF = float('inf')
dp = [INF] * (H + max(A))
dp[0] = 0
# dp[i]を、HP iを減らすために必要な最小の魔力とする

for hp in range(1, H+1):
  for n in range(N):
      dp[hp] = min(dp[max(hp-A[n],0)] + B[n], dp[hp])

print(dp[H])
# Judge status: Accepted
n,m=map(int,input().split())
ans=0
if n>=2:
    ans+=n*(n-1)//2
if m>=2:
    ans+=m*(m-1)//2
print(ans)
# Judge status: Accepted
N = int(input())
a = sorted(list(map(int, input().split())))[::-1]
print(sum(a[1::2][:N]))
# Judge status: Accepted
# C - Multiplication 3

a, b = input().split()
a = int(a)
assert b[-3] == '.'
b = int(b[:-3] + b[-2:])

print(a * b // 100)
# Judge status: Accepted
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    S = input()
    print(S[:3])

if __name__ == "__main__":
    main()
# Judge status: Accepted
from collections import deque
 
S = deque(input())
Q = int(input())
 
Q_list = [list(map(str, input().split())) for i in range(Q)]
 
rev = False
 
for i in range(Q):
  if int(Q_list[i][0]) == 1:
    rev = not rev
  
  else:
    F = Q_list[i][1]
    C = Q_list[i][2]
    
    if rev ^ (int(F) == 1): # 排他的論理和片方真片方ぎの時真になる
      S.appendleft(C)
    else:
      S.append(C)
      
if rev:
  S.reverse()
  
print(''.join(S))
# Judge status: Accepted
n=int(input())
a=[]
ans=0
for i in range(2,n):
    if i*i>n:
        break
    x=0
    while n%i==0:
        n//=i
        x+=1
    a.append(x)
if n!=1:
    ans+=1

for i in a:
    b=1
    while b<=i:
        i-=b
        b+=1
        ans+=1
print(ans)
# Judge status: Accepted
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if t*(v-w)>=abs(a-b):
	print("YES")
else:
	print("NO")
# Judge status: Accepted
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a
N, X = map(int, input().split())
x = list(map(int, input().split()))
x.insert(0, X)
distance = []
for i in range(1, len(x)):
    distance.append(abs(x[i] - x[i - 1]))

ans = distance[0]
for i in range(1, len(distance)):
    ans = gcd(ans, distance[i])
print(ans)
# Judge status: Accepted
a,b,t=map(int,input().split())
co=(t+0.5)//a
print(int(b*co))
# Judge status: Wrong Answer

w,a,b=map(int,input().split())
if b>=a+w:
    print(b-a-w)
else:
    if b+w>=a:
        print(b+w-a)
    else:
        print(a-b-w)
# Judge status: Wrong Answer
N,M=map(int,input().split())
ans=0
L,R=0,(10**5)+1
for i in range(M):
    l,r=map(int,input().split())
    L=max(L,l); R=min(R,r)
    if r<l: break
R=min(R,N)
print(abs((L-1)-R))
# Judge status: Wrong Answer
N = int(input())
s = []
for i in range(N):
  s.append(int(input()))

s.sort()
ans = sum(s)
if ans % 10 == 0:
  fil = list(filter(lambda x: x % 10 != 0, s))
  if len(fil) == 0:
    print(0)
  else:
    print(ans - s[0])
else:
  print(ans)
# Judge status: Accepted
A,B,C,K = map(int, input().split())

if A >= K:
    print(K)
elif A + B >= K:
    print(A)
else:
    L = K - A - B
    print(A - L)
# Judge status: Accepted
def resolve():
    A, B, C, X, Y = [int(i) for i in input().split()]
    # Cを0～max(X,Y)の2倍まで購入
    minA = float("inf")
    for i in range(0, max(X, Y) * 2 + 1, 2):
        sumA = C * i
        sumA += (A * (X - i // 2) if (X - i // 2) > 0 else 0)
        sumA += (B * (Y - i // 2) if (Y - i // 2) > 0 else 0)
        minA = min(minA, sumA)
    print(minA)


resolve()
# Judge status: Accepted
s, k = input().split(' ')
sn, kn = map(int, input().split(' '))
u = input()

if s == u:
    print(sn - 1, kn)
else:
    print(sn, kn - 1)
# Judge status: Accepted
from sys import stdin

n, k, q = map(int, stdin.readline().rstrip().split())
a = [0] * q
for i in range(q):
    a[i] = int(stdin.readline().rstrip())

l = [0] * (n+1)

for ai in a:
    l[ai] += 1

for i in range(n):
    j = i+1
    point = k - (q-l[j])
    if point <= 0:
        print('No')
    else:
        print('Yes')
# Judge status: Accepted
N = int(input())

K = [0] * (N+1)

for i in range(1, N+1):
    for j in range(i, N+1, i):
        K[j] += 1
ans = 0
for i in range(1, N+1):
    ans += i * K[i]
print(ans)
# Judge status: Accepted
from collections import Counter
s = input()
t = input()

s_count = Counter(s)
t_count = Counter(t)
if sorted(s_count.values()) == sorted(t_count.values()): print("Yes")
else: print("No")
# Judge status: Accepted
n,c,k=map(int,input().split())
t=[0]*n
for i in range(n):
  t[i]=int(input())
t.sort()
ans=1
temp=t[0]
tempc=1
for i in range(1,n):
  if temp+k<t[i] or tempc>=c:
    ans=ans+1
    temp=t[i]
    tempc=1
  else:
    tempc=tempc+1
print(ans)
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())

print( (a+b)*h//2 )
# Judge status: Accepted
import itertools
n,m,q=map(int,input().split())
l=[]
for i in range(q):
  a=list(map(int,input().split()))
  l.append(a)
#print(l)
ans=0
aa=0
for now in itertools.combinations_with_replacement(range(1,m+1), n):
  aa+=1
  ansn=0
  #print(now)
  for i in l:
    if now[i[1]-1]-now[i[0]-1]==i[2]:
      ansn+=i[3]
  #print(ansn)
  if ansn>ans:
    ans=ansn
#print(aa)
print(ans)
# Judge status: Accepted
N,A,B = input().split()
N,A,B = map(int,(N,A,B))
f=0
for i in range(1,N+1):
  k=i
  a = i//10000
  i = i-a*10000
  b = i//1000
  i = i-b*1000
  c = i//100
  i = i-c*100
  d = i//10
  i = i-d*10
  e = i
  s = a+b+c+d+e
  if A<=s<=B:
    f += k
print(f)
# Judge status: Wrong Answer
[a,b,c,d] = list(map(int,input().split()))

if abs(a-b)<=d:
  if abs(b-c)<=d:
    print('Yes')
  else:
    print('No')
else:
  print('No')
# Judge status: Accepted
a,b,x=map(int,input().split())
if x>=a and a+b>=x:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
n=int(input())
if n<=4:
  print(0)
  exit()
  
if n%2==1:
  print(0)
  exit()
  
cnt=10
ans=0

for i in range(100):
  ans+=n//cnt
  cnt*=5
  
  
print(ans)
# Judge status: Wrong Answer
import sys
n = int(sys.stdin.readline())
lia = list(map(int, sys.stdin.readline().split()))
lib = list(map(int, sys.stdin.readline().split()))
lic = list(map(int, sys.stdin.readline().split()))
s = sum(lib)
li = []
i = 0
while i < n-1:
  if lia[i+1] - lia[i] == 1:
    li.append(i)
  i += 1
for i in li:
  s += lic[i-1]
print(s)
# Judge status: Accepted
x,a,b = map(int, input().split())
if abs(x-a) <= abs(x-b):
    print("A")
else:
    print("B")
# Judge status: Accepted
a, b = map(int, input().split())
def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b
print(a*b//gcd(a, b))
# Judge status: Accepted
x, y = map(int, input().split())
ans = 0
if abs(x) == abs(y):
    ans = 1
elif abs(x) < abs(y):
    ans = abs(y) - abs(x)
    if y < 0:
        ans += 1
    if x < 0:
        ans += 1
else:
    if y == 0:
        ans = abs(x) + abs(y)
    else:
        ans = abs(x) - abs(y)
    if x > 0:
        ans += 1
    if y > 0:
        ans += 1

print(ans)
# Judge status: Accepted

n = list(input())

if n[0]=="A":
    if n[1]=="B":
        print("Yes")
    else:
        if n[2]=="B":
            print("Yes")
        else:
            print("No")
else:
    if n[1]=="A":
        print("Yes")
    else:
        if n[2]=="A":
            print("Yes")
        else:
            print("No")
# Judge status: Accepted
a,b,c,d=[int(x) for x in input().split()]
ans=max(a*c,b*d)
if a<0 and b<0:
  cc=a
  a=b
  b=cc

if c<0 and d<0:
  cc=c
  c=d
  d=cc

print(max(a*c,b*d,ans))
# Judge status: Wrong Answer
N = int(input())
ans = 0
m = float("inf")
for i in range(N):
    x = int(input())
    if m >= x:
        m = x
        ans += 1
print(ans)
# Judge status: Accepted
import bisect

N = 5
ARR = [6, 9, 4, 2, 11]


N = 2
ARR = [100, 0]

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


def calculate(n, arr):
    arr = sorted(arr)

    mid = arr[n - 1] / 2

    a1 = bisect.bisect_left(arr, mid)

    s1 = abs(arr[a1 - 1] - (arr[n - 1] / 2))
    s2 = abs(arr[a1] - (arr[n - 1] / 2))

    if s1 > s2:
        return arr[n - 1],arr[a1]
    else:
        return arr[n-1],arr[a1-1]


n, a = calculate(N, ARR)
print(n, a)
# Judge status: Accepted
S = input()
if set(S) == {'a', 'b', 'c'}:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
a = 10**N - 9**N -9**N + 8**N
print(a%(10**9+7))
# Judge status: Wrong Answer
A=int(input())
B=int(input())
AB=[A,B]
C=[1,2,3]
C.remove(A)
C.remove(B)
print(C)
# Judge status: Wrong Answer
N = int(input())

n = N
ans = 0
for i in range(N):
    d = n % 10
    n //= 10
    ans += min(d, 1 + 10 - d)
    if n == 0: break

print(ans)
# Judge status: Wrong Answer
n,a,b = map(int,input().split())

p = b-a-1

if p%2==0:
    print(b-1)
else:
    print((p+1)//2)
# Judge status: Accepted
N = int(input())
print((1000-(N%1000))%1000)
# Judge status: Wrong Answer
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

l = []
for i in range(A, min(A+K, B+1)):
    l.append(i)
for i in range(max(B-K, A+1), B+1):
    l.append(i)

l = list(set(l))
l.sort()
print(*l, sep="\n")
# Judge status: Accepted
N = int(input())

cnt = 0
for a in range(1, N):
    # print(f'{a=}, {N // a}')
    if N % a == 0:
        cnt += N // a - 1
    else:
        cnt += N // a

print(cnt)
# Judge status: Accepted
x=int(input())
s={1,}
for b in range(2,x):
    for p in range(2,100000):
        tmp=b**p
        if tmp>x:
            break
        s.add(tmp)
print(max(s))
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a == b:
  print(2*a-1)
else:
  print(max(a,b)*2-1)
# Judge status: Wrong Answer
n = int(input())

a = input().split(" ")
ab = a
for k in range(n):
    count = 0
    if not k == 0:
        a.insert(k-1, a[k-1])
    ab.pop(k)
    for i in range(n-1):
        for j in range(i):
            if a[i] == a[j] and not i == j:
                count = count + 1
    print(count)
# Judge status: Accepted
s=[]
sa=input()
sb=input()
sc=input()
s.append(sa)
s.append(sb)
s.append(sc)
now=0
while 1:
    if len(s[now])==0:
        break
    if s[now][0]=="a":
        next=0
    elif s[now][0]=="b":
        next=1
    else:
        next=2
    s[now]=s[now][1:]
    now=next
if now==0:
    print("A")
elif now==1:
    print("B")
else:
    print("C")
# Judge status: Wrong Answer
a = input()
b = input()
if a == b [::-1]:
    print('YES')
else:
    print('No')
# Judge status: Accepted
S = list(input())
ls = len(S)
na = S.count("a")
nb = S.count("b")
nc = ls - na - nb
mi = min(na, nb, nc)
ma = max(na, nb, nc)

if ma - mi <= 1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
a=input()
print(int(a)+int(a)*int(a)+int(a)*int(a)*int(a))
# Judge status: Wrong Answer
def solve():
  s=list(input())
  if(len(s)<2):
      print("No")
      return
  for i in range(len(s)):
      if (i%2==0 and s[i]!='h'):
          print("No")
          return
      elif(i%2==1 and s[i]!='i'):
          print("No")
          return
  print("Yes")

solve()
# Judge status: Wrong Answer
n = input()
a = input().split()
print(n, a)
# Judge status: Accepted
A,B = map(int,input().split())

if A + B < 24:
    print(A + B)
if A + B >= 24:
    print(A + B - 24)
# Judge status: Accepted
import numpy as np
s = input()
n = len(s)
ans = 0
for i in range(n // 2 + 1):
	if 2 * i == n:
		break
	if s[2 * i] == "0":
		ans += 1
	if 2 * i + 1 == n:
		break
	if s[2 * i + 1] == "1":
		ans += 1
print(min(ans, n - ans))
# Judge status: Wrong Answer
n,k=map(int,input().split())
a=[[int(i) for i in input().split()] for i in range(n)]
b=[]
x=0
if n==1:
    print(a[0][0])
    exit()
for i in a:
    x+=i[1]
    b.append([i[0],x])
for i in range(len(b)-1):
    if b[i][1]<k<=b[i+1][1]:
        print(b[i+1][0])
    elif i==0 and k<=b[i][1]:
        print(b[i][0])
    elif k>b[-2][1]:
        print(b[-1][0])
# Judge status: Wrong Answer
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    H1, M1, H2, M2, K = read_values()
    m1 = H1 * 60 + M1
    m2 = H2 * 60 + M2 - 1

    m = m2 - m1 
    print((m // K) * K)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N,L=map(int,input().split())
S=[input() for i in range(N)]
S.sort()
s=""
for i in S:
    s=s+i
print(s)
# Judge status: Wrong Answer
import collections
N = int(input())
A = list(map(int, input().split())) 
c = collections.Counter(A)

if c.most_common()[0][1] > 2:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
n, k = map(int, input().split())
s = list(input())
cnt = 0
tmp = s[0]
t = 0
for i in range(1, n):
    if tmp == s[i]:
        continue
    else:
        cnt += 1
        tmp = s[i]
c = 0
for i in range(1, n):
    if s[i] == s[i-1]:
        c += 1
if cnt <= 2*k:
    print(n-1)
else:
    print(c + 2*k)
# Judge status: Accepted
a = int(input())

if a == 0:
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
s = input()
l = []

for i in s:
  i = 'x'
  i += i*(len(s))
print(i)
# Judge status: Wrong Answer
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():
    L, R = map(int, readline().split())

    if R - L + 1 >= 2019:
        print(0)
    else:
        A = [i % 2019 for i in range(L, R + 1)]
        A.sort()
        print(A[0] * A[1])

    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
a = 0
b = n
total = []

def digitSum(number):
    sum = 0
    while number > 0:
        sum += number % 10
        number //= 10
    return sum

for i in range(1, n + 1):
    a = i
    b = n - a
    if b < a:
        break
    total.append(digitSum(a) + digitSum(b))
print(min(total))
# Judge status: Accepted
_ = int(input())
A = list(map(int, input().split()))
mi, ma = min(A), max(A)

cost = 10**10

for x in range(mi, ma+1):
    cost = min(cost, sum((x-a)**2 for a in A))

print(cost)
# Judge status: Accepted
def is_prime(x):
    if x <= 1:
        return False
    i = 2
    while i*i <= x:
        if x%i==0:
            return False
        i += 1
    return True
x = int(input())
while not(is_prime(x)):
    x += 1
print(x)
# Judge status: Accepted
n, d = map(int, input().split())
print(1 + (n - 1) // (d + d + 1))
# Judge status: Accepted
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

N, x = map(int, input().split())
a = [0] + list(map(int, input().split()))

ans = 0
for i in range(1,N+1):
    y = a[i-1] + a[i]
    if y > x:
        ans += y-x
        a[i] -= y-x
print(ans)
# Judge status: Wrong Answer
#input
a, b, c = map(int, input().split())
d, e, f = map(int, input().split())
h, i, j = map(int, input().split())
N = int(input())
b = [0] * N
for i in range(N):
    b[i] = int(input())

#output
if a and b and c in b:
    print("Yes")
elif d and e and f in b:
    print("Yes")
elif h and i and j in b:
    print("Yes")
elif a and d and h in b:
    print("Yes")
elif b and e and i in b:
    print("Yes")
elif c and f and j in b:
    print("Yes")
elif a and e and j in b:
    print("Yes")
elif c and e and h in b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ai = max(a)
a.sort(key=lambda x: abs(ai//2 - x))
aj = a[0]
for i in a:
    if ai==i: continue
    else:
        aj = i
        break

print('{} {}'.format(ai, aj))
# Judge status: Accepted
a,b,x=map(int,input().split())
if x-a<=b and x-a>=0:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
import math

N, K = map(int, input().split())
A = list(map(float, input().split()))

if K == 0:
  print(int(max(A)))
  exit()

if N == 1:
  print(math.ceil(A[0]/K))
  exit()


min_A = 0
max_A = max(A)

while( max_A - min_A > 1):
  now = (min_A + max_A) / 2
  temp = 0
  for i in A:
    temp += int(i / now)
  if temp > K:
    min_A = now
  else:
    max_A = now
  
print(int(min_A) + 1)
# Judge status: Wrong Answer
n, m = map(int, input().split())
ab = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x:x[0])

ans = 0
for i in range(n):
    print(ab[i][1], m)
    if ab[i][1] < m:
        ans += ab[i][0] * ab[i][1]
        m -= ab[i][1]
    else:
        ans += ab[i][0] * m
        break

print(ans)
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()
import math

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

cos = math.cos(math.radians(6 * M - 0.5 * (H * 60 + M)))

ans = A ** 2 + B ** 2 - 2 * A * B * (cos)
print(ans ** 0.5)