peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n = int(input())
s = input()
wh = [0] * n
bl = [0] * n

w , b = 0,0
for i in range(n):
  if s[i] == '.':
    w += 1
  else:
    b += 1
  wh[i] = w
  bl[i] = b

ans = n
wtot = wh[-1]
btot = bl[-1]
for i in range(n):
  x = (wtot - wh[i]) + bl[i]
  ans = min(ans, x)
print (ans)
# Judge status: Accepted
a,b,x = map(int, input().split())

# a,b,x = map(int, "9 9 2".split())
cnt=0

alfa = b//x + 1
beta = (a-1)//x + 1

print(alfa - beta)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print("YES" if a<c<b or b<c<a else "NO")
# Judge status: Accepted
a,b,c=map(int,input().split())
print(min(c,b//a))
# Judge status: Wrong Answer

def solve():
    ans = 10**8
#    print(x[2])
    for i in range(N-K+1):
        #print(i)
        ans = min(ans, abs(x[i])+abs(x[i]-x[i+K-1]), abs(x[i+K-1])+abs(x[i+K-1]-x[i]))
    print(ans)

if __name__=="__main__":
    N,K = list(map(int, input().split()))
    x = list(map(int, input().split()))
    solve()
# Judge status: Accepted
a1, a2, a3 = list(map(int, input().split()))

if a1+a2+a3>21:
	print('bust')
else:
	print('win')
# Judge status: Accepted
import re

S = input()

hslist = ["hi","hihi","hihihi","hihihihi","hihihihihi"]

if S in hslist:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a,b,c = map(int, input().split())
print(0) if a-b-c >= 0 else print(abs(a-b-c))
# Judge status: Wrong Answer
import numpy as np

N = int(input())
A = np.asarray(input().split()).astype(np.int)
A_sq = np.square(A)
Ans = ((A.sum())**2 - A_sq.sum()) // 2 % (10**9+7)
print(Ans)
# Judge status: Accepted
a, b, x = [int(i) for i in input().split()]

print(b // x - (a-1) // x)
# Judge status: Accepted
n = int(input())
li = [int(x) for x in input().split()]

dp = [float("inf")]*n
dp[0] = 0
dp[1] = abs(li[1]-li[0])
for i in range(2,n):
    dp[i] = min(dp[i-1]+abs(li[i]-li[i-1]),dp[i-2]+abs(li[i]-li[i-2]))
print(dp[n-1])
# Judge status: Wrong Answer
s = input()
s=s[::-1]
i=0
ans="YES"
while True:
    if len(s)==i:
        break
    elif s[i:i+5]=="maerd":
        i+=5
    elif s[i:i+7]=="remared":
        i+=7
    elif s[i:i+5]=='esare':
        i+=5
    elif s[i:i+6]=='resare':
        i+=6
    else:
        ans="NO"
        break
print(ans)
# Judge status: Wrong Answer
from operator import itemgetter


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

i=0
while i<N:
    A[i][1]=int(A[i][1])
    i+=1

i=0
while i<N:
    A[i]=tuple(A[i])
    i+=1

B1 = sorted(A, key=itemgetter(1),reverse=True)
B2 = sorted(B1,key=itemgetter(0))

print(B2)

for i in B2:
    print(A.index(i)+1)
# Judge status: Wrong Answer
import math
 
X = int(input())
x=int(math.sqrt(X))

for i in range(X,100001):
    c=0
    for j in range(2,x+1):
        if i%j != 0:
            continue
        else:
            c=1
            break
    if c==0:
        print(i)
        break
# Judge status: Accepted
if int(input()) <= 999:
    print("ABC")
else:
    print("ABD")
# Judge status: Accepted
a,b,x=map(int,input().split())
print(max(b//x-(a-1)//x,0))
# Judge status: Accepted
import collections

N = int(input())
S = [input() for _ in range(N)]

cnt = collections.Counter(S)
max_cnt = max(cnt.values())

ans_list = []

for key, value in cnt.items():
    if value == max_cnt:
        ans_list.append(key)

print(*sorted(ans_list), sep='\n')
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
x = Counter(a)
ans = 0
for i in range(10**5 + 1):
    ans = max(ans, x[i - 1] + x[i] + x[i + 1])
print(ans)
# Judge status: Accepted
from math import gcd

k = int(input())


ans = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            ans += gcd(gcd(a, b), c)
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
import fractions
def gcdlist(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = fractions.gcd(ans, a[i])
    return ans
print(gcdlist(a))
# Judge status: Wrong Answer
s = input()

if s[2] == s[3]:
    if s[4] == s[5]:
        print('Yes')
else:
    print('No')
# Judge status: Accepted
from sys import stdin
r = int(stdin.readline().rstrip())

ans = r**2
print(ans)
# Judge status: Accepted
N = int(input())
card_list = list(map(int, input().split()))
card_list.sort(reverse=True)

alice = 0
bob = 0

for i, card in enumerate(card_list):
    if i%2 == 0:
        alice += card
    else:
        bob += card

print(abs(alice - bob))
# Judge status: Wrong Answer
import math

X = int(input())
ans = 0

for i in reversed(range(X)):
  num = int(math.sqrt(i))
  if num ** 2 == i and ans < i:
    ans = i

print(ans)
# Judge status: Accepted
import math
a,b,x = map(int,input().split())

if 2 * x <= a**2 * b:
    # x = a * b * w / 2
    w = 2 * x / (a*b)
    print(math.degrees(math.atan(b/w)))
else:
    # a * a * b - x = (h * a * a) / 2
    h = 2 * (a**2 * b - x) / (a**2)
    print(math.degrees((math.atan(h/a))))
# Judge status: Accepted
a=[int(input()) for i in range(5)]
b= [(a[i]+10-1)%10 for i in range(5)]

n=b.index(min(b))
p=a.pop(n)
c=[(a[i]+10-1)//10*10 for i in range(4)]
m=sum(c)+p
print(m)
# Judge status: Accepted
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ords = []
    for i, a in enumerate(A):
        ords.append((i, a))
    ans = list(map(lambda x: x[0]+1, sorted(ords, key=lambda x: x[1])))
    print(*ans)
    
        
    


    
if '__main__' == __name__:
    resolve()
# Judge status: Accepted
a=list(input())
if a[0]==a[1]==a[2]:
  print('No')
else:
  print('Yes')
# Judge status: Wrong Answer
X,Y=map(int,input().split())
print(int(X)+int(Y)/2)
# Judge status: Accepted
N,M = map(int,input().split())
if N == M:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b = map(int, input().split())
print('Possible' if a % 3 == 0 or b % 3 == 0 or (a + b ) % 3 == 0 else 'Impossible')
# Judge status: Accepted
S = input()

t = 0
stock = 0
for c in S:
    if c == "S":
        stock += 1
    elif stock == 0:
        t += 1
    else:
        stock -= 1
print(t + stock)
# Judge status: Accepted
l=input()
a=l.count("a")
b=l.count("b")
c=l.count("c")
if all([abs(a-b)<=1,abs(a-c)<=1,abs(b-c)<=1]):
   print("YES")
else:
   print("NO")
# Judge status: Accepted
N = int(input())
S = input()
alpha = [0]*26
mod = 10**9+7

for n in S:
    num = ord(n)-97
    alpha[num] += 1
    
ans = 1
for i in range(26):
    ans *= (alpha[i]+1)


ans %= mod
print(ans-1)
# Judge status: Wrong Answer
S = str(input())
l = [2019]*10**5
count = 0
for i in range(10**5):
  l[i] *= (i+1)
for j in range(10**5):
  if str(l[j]) in S:
    count += 1
print(count)
# Judge status: Wrong Answer
S=str(input())
if 'a' and 'b' and 'c' in S:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
c_1 = list(map(int, input().split()))
c_2 = list(map(int, input().split()))
c_3 = list(map(int, input().split()))
c = c_1 + c_2 + c_3
if sum(c) == 3 * (c_1[0] + c_2[1] + c_3[2]):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s = str(input())
n = ord(s)
print(chr(n+1))
# Judge status: Accepted
a, b, t = map(int, input().split())
print(t // a * b)
# Judge status: Accepted
n,k=map(int,input().split());print(sum(n>=k**i for i in range(100)))
# Judge status: Accepted
n,a,b = map(int,input().split())

margin = abs(a-b)

if (a % 2 == 0 and b % 2 == 0) or (a % 2 == 1 and b % 2 == 1):
    print(margin//2)
else:
    t = min(a-1, n-b) + 1 +(b-a-1)//2
    print(t)
# Judge status: Wrong Answer
if __name__ == '__main__':
    n = int(input().strip())
    ans = 0

    for i in range(1, n+1):
        limit = int(n / i)
        ans += limit * (limit + 1) / 2
    print(int(ans))
# Judge status: Accepted
#44 C - pushpush AC
n = int(input())
a = list(map(int,input().split()))

odd = [a[i] for i in range(n) if i%2 == 1] # O(n)
even = [a[j] for j in range(n) if j%2 == 0]# O(n)

if n%2 == 0:
    ans = list(reversed(odd)) + even # O(n)
else:
    ans = list(reversed(even)) + odd # O(n)
print(*ans)
# Judge status: Wrong Answer
x,y,z=map(int,input().split())
print((x-y)//(y+z))
# Judge status: Wrong Answer
import sys
N = int(input())
s = input()
t = input()
for i in range(N):
    for j in range(N - i):
        flg = True
        if s[i + j] != t[j]:
            flg = False
            break
        if flg:
            print(N + i)
            sys.exit()
print(2 * N)
# Judge status: Wrong Answer
a,b = map(int,input().split())

min8 = a/8*100
max8 = (a+1)/8*100
min10 = b*10/1
max10 = (b+1)*10/1
ans = -1
for i in range(min(int(min8),int(min10)),max(int(max8),int(max10))+1):
    i = float(i)
    if min8 < i and max8 > i and min10 < i and max10 > i:
        ans =  int(i)
print(ans)
#デバッグ用
#print(ans/100*8,ans/100*10)
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())

for i in range(n-k):
    if t[i] == t[i+k]:
        t[i+k] = 0
print(sum([t.count("r")*p, t.count("s")*r, t.count("p")*s]))
# Judge status: Accepted
alphabet=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
z=input()
for i in range(26):
  if z==alphabet[i]:
    print(alphabet[i+1])
# Judge status: Accepted
n = int(input())
a = tuple(map(int, input().split()))
cnt = len(list(filter(lambda x: x % 2 == 1 or (x % 3 == 0 or x % 5 == 0), a)))
ans = 'APPROVED' if cnt == n else 'DENIED'
print(ans)
# Judge status: Wrong Answer
a, b, c, d = list(map(int, input().split()))
if abs(c-a) > d or a == c:
    print("Yes")
elif abs(b-a) > d and abs(b-c) > d:
    print("Yes")
elif a == b and b == c:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x = input()
if(x==0):
  print("1")
else:
  print("0")
# Judge status: Accepted
N,K = list(map(int,input().split()))
r = set()
for i in range(K):
  d = int(input())
  r |= set(map(int,input().split()))
print(N-len(r))
# Judge status: Accepted
S=str(input())
l=len(S)
c=0
for i in range(0,l//2):
    if S[i]!=S[l-i-1]:
        c=c+1
print(c)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
r=0
k=-9
for i,j in enumerate(a):
    r+=b[j-1]
    if j-1==k+1:
        r+=c[j-2]
    k=j-1
print(r)
# Judge status: Accepted
a,b,c,d = input()
for i in range(2**3):
    ku = ["+", "+", "+"]
    for j in range(len(ku)):
        if(i>>j)&1:
           ku[j]= "-"
    if eval(a+ku[0]+b+ku[1]+c+ku[2]+d) == 7:
     print(a+ku[0]+b+ku[1]+c+ku[2]+d+"=7")
     break
# Judge status: Accepted
l = set(map(int,input().split()))
print('Yes'if l <= set([1,3,5,7,8,10,12])or l <= set([4,6,9,11] )else 'No')
# Judge status: Accepted
import sys
n = int(input())  
w = [input() for i in range(n)]


if len(w) != len(set(w)):
    print('No')
    sys.exit()
else:
    for i, name in enumerate(w):

        try:
            if name[-1] != w[i+1][0]:
                print('No')
                sys.exit()

        except IndexError:
            print('Yes')
# Judge status: Wrong Answer
print(ord("z") - ord("a"))
s=list(input())
K=int(input())
for i in range(len(s)-1):
    a= ord("z")+1 - ord(s[i])
    if K>=a:
        s[i]="a"
        K-=a
print(K)
if K:
    s[-1]=chr((K+ord(s[-1])-ord("a"))%(ord("z") - ord("a")+1)+ord("a"))
print("".join(s))
# Judge status: Accepted
a,b=int(input()),int(input())
print("Yes") if a%500<=b else print("No")
# Judge status: Accepted
S = input()

climate = ["Sunny", "Cloudy", "Rainy"]

print(climate[(climate.index(S)+1)%3])
# Judge status: Accepted
N, M = map(int, input().split())
L = []
R = []
for _ in range(M):
  l, r = map(int, input().split())
  L.append(l)
  R.append(r)
l = max(L)
r = min(R)
print(r-l+1 if r-l+1 > 0 else 0)
# Judge status: Accepted
X = int(input())
num = [105, 104, 103, 102, 101, 100]

dp = [0 for _ in range(X+1)]
dp[0] = 1
f = 1

for i in range(X+1):
    for j in num:
        if i-j >= 0:
            if dp[i-j]:
                dp[i] = 1

print(dp[X])
# Judge status: Wrong Answer
A, B = map(int, input().split())
if((A and B)<=9):
    print(int(A*B))
else:
    print('-1')
# Judge status: Wrong Answer
N = int(input())
withdrawal_amount_list = sorted(
    [9**3, 9**2, 9, 6**3, 6**2, 6, 1], reverse=True)
count = 0
for price in withdrawal_amount_list:
    if N >= price:
        count += (N // price)
        N %= price
print(count)
# Judge status: Wrong Answer
import sys
from fractions import gcd

read = sys.stdin.read
N, M, *a = map(int, read().split())

lcm = a[0]
for i in a:
    g = gcd(lcm, i)
    lcm = lcm * i // g

lcm //= 2
if M < lcm:
    print(0)
else:
    print((M - lcm) // (lcm * 2) + 1)
# Judge status: Accepted
a = []
for _ in range(5):
    a.append(int(input()))
res = 0
last_num = a[0]
for i in range(5):
    if a[i] % 10 == 0:
        res += a[i]
    else:
        if last_num % 10 == 0:
            last_num = a[i]
        elif a[i] % 10 < last_num % 10:
            last_num = a[i]
        res += (a[i] // 10 + 1) * 10

if last_num % 10 != 0:
    res -= 10 - last_num % 10
print(res)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n):
    for j in range(1,n):
        if n <= i*j:
            break
        else:
            ans += 1
print(ans)
# Judge status: Accepted
n = [int(tmp) for tmp in input().split()]
a = []
for i in range(n[0]) :
	s = input()
	a.append(s)
a.sort()
print(''.join(a))
# Judge status: Accepted
n,m=map(int,input().split())
sc=[list(map(int,input().split())) for i in range(m)]
start=10**(n-1)
end=10**n
if n == 1:
    start = 0
for i in range(start,end):
    i=str(i)
    for s,c in sc:
        if i[s-1] != str(c):
            break
    else:
        print(i)
        exit()
print(-1)
# Judge status: Wrong Answer
n = int(input())
if n < 1000:
    print('ABC{:03d}'.format(n))
else:
    print('ABD{:03d}'.format(n - 1000 + 1))
# Judge status: Accepted
N,P = map(int, input().split())
A = [int(a) for a in input().split()]

even = 0
odd = 0
for a in A:
    if a%2 == 0:
        even += 1
    else:
        odd += 1

if odd == 0:
    if P == 0:
        ans = pow(2, N)
    else:
        ans = 0
else:
    ans = pow(2, N-1)

print(ans)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
a=0
s=[]
for i in A:
  if i<a:
    s.append(a-i)
    a=i
  else:
    a=i
print(sum(s))
# Judge status: Accepted
n=int(input())
k=int(input())
x=int(input())
y=int(input())
pay=0
for i in range(1,n+1):
    if i<=k:
        pay=pay+x
    else:
        pay=pay+y



print(pay)
# Judge status: Accepted
arr = []
ans = []
for i in range(3):
  arr.extend(list(map(int,input().split())))
N = int(input())
for j in range(N):
  num = int(input())
  if num in arr:
    ans.append(arr.index(num))
ans = set(ans)
if (set([0,1,2])<=ans)or(set([3,4,5])<=ans)or(set([6,7,8])<=ans)or(set([0,3,6])<=ans)or(set([1,4,7])<=ans)or(set([2,5,8])<=ans)or(set([0,4,8])<=ans)or(set([2,4,6])<=ans):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
  print("Possible")
else:
  print("Impossible")
# Judge status: Accepted
n = int(input())
v = list(map(float, input().split()))

v.sort()
while(True):
    if len(v) == 1:
        break
    else:
        x = v.pop(0)
        y = v.pop(0)
        v.append((x+y)/2)
        v.sort()

print(v[0])
# Judge status: Accepted
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    a, b, c = nm()

    if a + b >= c:
        print('Yes')
    else:
        print('No')
        

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a, b , n = map(int, input().split())
def floor_abx(a, b, x):
    return int(a*x/b) - int(x/b)*a 
    
res = 0
for i in range(n+1-a, n+1):
    num = floor_abx(a, b, i)
    if res < num:
        res = num
for i in range(1, a):
    num = floor_abx(a, b, i)
    if res < num:
        res = num
print(res)
# Judge status: Wrong Answer
n, m = map(int, input().split())
if n == 1 and m == 1:
    print(0)
elif n == 1:
    print(m - 2)
elif m == 1:
    print(n - 2)
else:
    print((n - 2) * (m - 2))
# Judge status: Accepted
s=input().rstrip()
print(s.rfind('Z')-s.find('A')+1)
# Judge status: Accepted
import collections

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

a = list(map(int, input().split()))
c= collections.Counter(a)

length = n - c.most_common()[0][1] + 1

if length == 1:
    ans = 0
else:
    ans = (length + k - 3) // (k - 1)
    
print(ans)
# Judge status: Accepted
S=input()
T=input()
x=0
for i in range(len(S)):
    if S[i]!=T[i]:
        x+=1
print(x)
# Judge status: Wrong Answer
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    a, b, c = map(int, input().split())
    if ~a&1 and ~b&1 and ~c&1:
        print(0)
    else:
        print(min(a * b, b * c, c * a))
resolve()
# Judge status: Accepted
n = int(input())
lst = list(map(int, input().split()))

count = 0
ans = 0
for i in range(n):
  if lst[i] < 0:
    count += 1
    lst[i] = abs(lst[i])
  ans += lst[i]
  
if count % 2 == 1:
  ans -= 2*min(lst)
  
print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
A=list(map(int,input().split()))
if N-sum(A)>=0:
    print(N-sum(A))
else:
    print(-1)
# Judge status: Wrong Answer
N, M = map(int, input().split())

dic_1 = dict()
for i in range(N):
    a, b = map(int, input().split())
    dic_1[a] = b

dic_2 = sorted(dic_1.items())

cost = 0
cost_prev = 0
cnt = 0
cnt_prev = 0
flg = False
for key, value in dic_2:
    if flg:
        break
    cost += key*value
    cnt += value

    if cnt >= M:
        dif = M-cnt_prev
        cost_prev += key*dif
        flg = True

    if flg == False:
        cost_prev = cost
        cnt_prev = cnt

print(cost_prev)
# Judge status: Accepted
A,B,C,K=map(int,input().split())

if abs(A-B)>10**18:
    print("Unfair")
else:
    print((A-B)*(-1)**K)
# Judge status: Accepted
n , k , q = map(int,input().split())
p = [0 for i in range(n)]
for i in range(q):
    a = int(input())
    p[a-1] += 1

for i in range(n):
    if k - q + p[i] <= 0:
        print("No")
    else:
        print("Yes")
# Judge status: Accepted
def main():
    X = int(input())
    t = 0

    for i in range(10**5):
        t += X
        if t % 360 == 0:
            return i + 1

print(main())
# Judge status: Wrong Answer
N, K = list(map(int,input().split()))
xlist = list(map(int,input().split()))

def f(min1,max1):
  #min1 = list1[0]
  #max1 = list1[-1]
  if min1>=0 and max1>=0:
    return abs(max1)
  elif min1<=0 and max1 <=0:
    return abs(min1)
  else:
    return min([-2*min1 + max1,-min1 + 2*max1])

ans = 2*10**8 + 2
for i in range(N-K+1):
  min1 = xlist[i]
  max1 = xlist[i+K-1]
  dist =f (min1,max1) 
  if dist < ans :
    ans = dist

print(ans)
# Judge status: Accepted
s=input()
print("AC" if "C" in s[2:-1] and "A" in s and s[1:].replace("C","",1).islower() else "WA")
# Judge status: Accepted
n = int(input())
if n % 2 == 0:
    o = n//2

else:
    o = (n+1)// 2
print(o / n)
# Judge status: Accepted
n = int(input())
for i in range(1,10):
    for j in range(1,10):
        if n == i*j:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
n,k,q=map(int,input().split())
a,b=[int(input()) for _ in range(q)],[0]*n
for i in a:
    b[i-1]+=1
for i in b:
    print('Yes' if i+k-q>0 else 'No')
# Judge status: Wrong Answer
from collections import deque
n = int(input())
A = list(map(int, input().split()))
B = deque()

for i in range(n):
    if i % 2 == 0:
        B.append(A[i])
    else:
        B.appendleft(A[i])
print(*B)
# Judge status: Accepted
A,B = map(int,input().split())
print(A*B)
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n <= k:
  print(n*x)
else:
  print(k*x + (n-k)*y)
# Judge status: Accepted
N = int(input())
S = input()
left = 0
right = 0
cnt1 = 0
for i in S:
    if i == '(':
        left += 1
    else:
        right += 1
    cnt1 = max(cnt1, right - left)
left = 0
right = 0
cnt2 = 0
for i in S[::-1]:
    if i == ')':
        left += 1
    else:
        right += 1
    cnt2 = max(cnt2, right - left)
ans = '(' * max(0, cnt1) + S + ')' * max(0, cnt2)
print(ans)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if b <= c or d <= a:
    print(0)
elif a <= c and d <= b:
    print(d - c)
elif a <= c and b <= d:
    print(b - c)
elif c <= a and b <= d:
    print(b - a)
elif c <= a and d <= b:
    print(d - a)
# Judge status: Accepted
from collections import deque
from bisect import bisect_left

N = int(input())
A = [int(input()) for _ in range(N)]

t = deque([A[0]])
for a in A[1:]:
    if a <= t[0]:
        t.appendleft(a)
    else:
        t[bisect_left(t, a) - 1] = a
print(len(t))
# Judge status: Accepted
# coding: utf-8
S = list(input())
T = list(set(S))
print("yes" if len(S) == len(T) else "no")
# Judge status: Accepted
n = int(input())
if 400 <= n <= 599:
    print(8)
elif 600 <= n <= 799:
    print(7)
elif 800 <= n <= 999:
    print(6)
elif 1000 <= n <= 1199:
    print(5)
elif 1200 <= n <= 1399:
    print(4)
elif 1400 <= n <= 1599:
    print(3)
elif 1600 <= n <= 1799:
    print(2)
else:
    print(1)
# Judge status: Accepted
n,a=open(0)
*a,=map(int,a.split())
m=max(a)
print(m,min((abs(m-2*i),i)for i in a)[1])
# Judge status: Wrong Answer
s=list(input())
x=''.join(s[0::2])
y=''.join(s[1::2])
if 'R' in x and 'D' in x and 'U' in x:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys

stdin = sys.stdin

mod = 1000000007

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

m = na()
m.sort()
print(m[0] + m[1])
# Judge status: Accepted
n = int(input())
t,a = map(int,input().split())
ls = list(map(int,input().split()))
p = 0
j = 0
for i in range(n):
    if i ==0:
        tem = t - 0.006*ls[i]
        ans = abs(tem-a)
        j = 1
    else:
        tem = t - 0.006*ls[i]
        if ans - abs(tem-a) >0:
            ans = abs(tem-a)
            j = i + 1
print(j)
# Judge status: Wrong Answer
import itertools
n = int(input())
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
l = []
for it in itertools.combinations(divisor(n),2):
    if it[0] * it[1] == n:
        l.append(it[0] + it[1] -2)
print(sorted(l)[0])
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

A = sorted(li())

print(A[0] * A[1] // 2)
# Judge status: Accepted
def main():
    n = int(input())
    s = sorted([input().split()+[i+1] for i in range(n)],key=lambda x:(x[0],-int(x[1])))
    for i in range(n):
        print(s[i][2])

if __name__ == '__main__':
    main()
# Judge status: Accepted
from bisect import bisect_right

N,M,K = map(int,input().split())
A = [0]+list(map(int,input().split()))
B = [0]+list(map(int,input().split()))
for i in range(1,N+1,1):
    A[i]=A[i-1]+A[i]
for i in range(1,M+1,1):
    B[i]=B[i-1]+B[i]

ans = 0
for i in range(0,N+1,1):
    j = bisect_right(B,K-A[i])-1
    if K-A[i]>=0:
        ans = max(ans,i+j)
print(ans)
# Judge status: Wrong Answer
c=[list(map(int, input().split())) for _ in range(3)]
p=sum(c[0])%3
print("Yes" if (sum(c[1])-p)%3==(sum(c[2])-p)%3==0 else "No")
# Judge status: Accepted
import sys
readline = sys.stdin.readline

N = int(readline())
A = list(map(int,readline().split()))

ans = [0] * N

for i in range(len(A)):
  ans[A[i] - 1] += 1
  
for a in ans:
  print(a)