peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
print((n-1)*n//2)
# Judge status: Wrong Answer
L, R, d = [int(i) for i in input().split(' ')]
first = L if L == d else (L//d + 1) * d
ans = 0
for i in range(first,R+1,d):
    ans += 1
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]
h_sort=sorted(h)
a=0
b=10**20
for i in range(k, n+1):
	a=h_sort[i-1] - h_sort[i-k]
	if a<b:
		b=a
print(b)
# Judge status: Accepted
s=input()
T=input()

s=''.join([x if x!='?' else '1' for x in list(s)])

start=[]
for i in range(len(s)-len(T)+1):
    tmp=0
    for j in range(len(T)):
        if s[i+j]==T[j] or s[i+j]=='1': tmp+=1
    if tmp==len(T): start.append(i)

candidates=[]
t=len(T)
ans=''
if len(start):
    for st in start:
        tmp=s[:st]+T+s[st+t:]
        candidates.append(tmp)
    candidates.sort()
    ans=candidates[0].replace('1','a')
else:
    ans='UNRESTORABLE'

print(ans)
# Judge status: Accepted
N=int(input())
S=input()
c=0
if N%2==1:
  print("No")
else:
  m=N//2
  for i in range(N//2):
    if S[i]==S[m+i]:
      c=c+1
      if c==N//2:
        print("Yes")
    else:
      print("No")
# Judge status: Accepted
D,T,S=map(int,input().split())

if D/S<=T:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
# cook your dish here
n=int(input())
n=n%10
if n in [2,4,5,7,9]:
    print('hon')
if n in [0,1,6,8]:
    print('pon')
if n==3:
    print('bon')
# Judge status: Accepted
x = int(input())
print('Yes') if x >= 30 else print('No')
# Judge status: Wrong Answer
N = int(input())
A = []
B = []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
C = list(zip(B, A))
C.sort()
B, A = zip(*C)
t = 0
for c in C:
    t += c[1]
    if t <= c[0]:
        continue
    else:
        print('no')
        exit()
print('yes')
# Judge status: Accepted
from string import ascii_lowercase

s = input()
k = int(input())

d = {c: (26 - i) % 26 for i, c in enumerate(ascii_lowercase)}

ret = ''
for c in s[:-1]:
    if d[c] <= k:
        k -= d[c]
        ret += 'a'
    else:
        ret += c

k %= 26
idx = (ascii_lowercase.index(s[-1]) + k) % 26
c = ascii_lowercase[idx]
ret += c

print(ret)
# Judge status: Wrong Answer
H = int(input())
W = int(input())
N = int(input())

L = max(H, W)

for i in range(1, L+1):
  if N < L*i:
    break

print(i)
# Judge status: Wrong Answer
from collections import deque
def main(k):
    q = deque([])
    for i in range(10):
        q.append(i)
    
    count = 0
    top = -1
    while True:
        top = q.popleft()

        count += 1
        if count == k:
            return top

        if top%10 != 0:
            q.append(top*10 + top%10-1)
        q.append(top*10 + top%10)
        if top%10 != 9:
            q.append(top*10 + top%10 + 1)

    return top

k = int(input())
main(k)
# Judge status: Accepted
n=int(input())
count=0
ans=0
for i in range(n):
    a=int(input())
    if a==0:
        ans+=(count//2)
        count=0
    else:
        count+=a
print(ans+count//2)
# Judge status: Wrong Answer
N,M = map(int,input().split())
Shop_List = [list(map(int,input().split())) for i in range(N)]
Shop_List = sorted(Shop_List, key=lambda x:x[0])
Number_Counter = 0
Yen_Counter = 0
for i in range(N):
    if Number_Counter + Shop_List[i][1] <= M:
        Number_Counter += Shop_List[i][1]
        Yen_Counter = Shop_List[i][0]*Shop_List[i][1]
    elif Number_Counter + Shop_List[i][1] > M:
        Yen_Counter += (M-Number_Counter)*Shop_List[i][0]
        Number_Counter = M
    elif Number_Counter == M:
        break

print(Yen_Counter)
# Judge status: Wrong Answer
n = int(input())
s = list(input() for _ in range(n))
print("AC × " + str(s.count("AC")))
print("WA × " + str(s.count("WA")))
print("TLE × " + str(s.count("TLE")))
print("RE × " + str(s.count("RE")))
# Judge status: Accepted
A,B,C=map(int,input().split())
if A%2==0 or B%2==0 or C%2==0:
  ans = 0
else:
  ans = min(A*B,B*C,C*A)
print(ans)
# Judge status: Wrong Answer
c=input()
if c=='a' or  c=='i' or  c=='d' or  c=='e' or  c=='o' :
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7
d = [0]*60
for i in range(n):
    for j in range(60):
        if a[i] >> j & 1 == 1:
            d[j] += 1

ans = 0
for j in range(60):
    ans += 2**j * d[j] * (n - d[j]) % mod

print(ans % mod)
# Judge status: Accepted
import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7

def factorial(N, mod=MOD):
    res = 1
    for i in range(2, N+1):
        res *= i
        res %= mod
    return res

def main():
    N, M = map(int, readline().rstrip().split())
    if abs(N-M) > 1:
        ans = 0
    elif N == M:
        ans = factorial(N) ** 2 * 2
    else:
        ans = factorial(min(N, M)) ** 2 * max(N, M)

    print(ans % MOD)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import math

# def comb_count(n, r):
#     return math.factorial(n) // math.factorial(r) // math.factorial(n - r)

S = input()[::-1]
ans = 0

mods = [0] * 2019 #余りが0~2018
mods[0] = 1
current = 0
tmp = 1

for i in range(len(S)):
    current = (int(S[i]) * tmp + current) % 2019
    mod = current % 2019
    ans += mods[mod]
    mods[mod] += 1
    tmp = tmp * 10 % 2019

# for mod in mods:
#     if mod > 1:
#         ans += comb_count(mod, 2)
print(ans)
# Judge status: Wrong Answer
#!/usr/bin/env python
# coding: utf-8

# In[58]:


s = input()
t = input()


# In[59]:


s_list = [[w,0] for w in s]
t_list = [[w,1] for w in t]
mylist = sorted(s_list+t_list, key=lambda x: x[1], reverse=True)
mylist = sorted(mylist, key=lambda x: x[0])
for i in range(len(t)):
    if mylist[i][1] != 1:
        print("Yes")
        break
else:
    print("No")


# In[ ]:
# Judge status: Accepted
def a():
    x = int(input())
    k = 1
    while (k * x) % 360 != 0:
        k += 1
    print(k)


a()
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
M = 1000
K = 0

for i in range(1, N):
  if A[i-1] < A[i]:
    K = M // A[i-1]
    M = M % A[i-1]
    if i == N-1:
      M += K * A[i]
  elif A[i-1] > A[i]:
    if K > 0:
      M += K * A[i-1]
      K = 0  
print(M)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from decimal import Decimal

a, b = map(float, readline().split())
a = Decimal(str(a))
b = Decimal(str(b))
print(int(a * b))
# Judge status: Accepted
N=int(input())
import math
x=math.floor(math.log10(N))+1
ans=0
for i in range(1,x,2):
  ans+=9*10**(i-1)
if x%2==1:
  ans+=N-10**(x-1)+1
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a == b:
  print('Draw')
elif b == 1 and a < b:
  print('Bob')
elif a == b:
  print('Draw')
else:
  print('Alice')
# Judge status: Accepted
N, M=map(int,input().split())
H=list(map(int,input().split()))
ans=[1]*N
for i in range(M):
  A, B=map(int, input().split())
  if H[A-1]>H[B-1]:
    ans[B-1]=0
  elif H[B-1]>H[A-1]:
    ans[A-1]=0
  elif H[A-1]==H[B-1]:
    ans[A-1]=0
    ans[B-1]=0
print(sum(ans))
# Judge status: Accepted
import sys
input = sys.stdin.readline

def main():
	N = int(input())
	S = input().rstrip()
	M = 10**9 + 7
	
	# a     (0)+1
	# ab    (1)+1+1
	# abc   (3)+3+1
	# abca  (7)+1+2+1
	# abcab (11)+1+3+2
	# abcabc (17)+1+4+3
	A = ord("a")
	res = 1
	for i in range(26):
		q = chr(i+A)
		qc = S.count(q)
		res = res * (qc+1) % M
		
	print((res-1) % M)
	
main()
# Judge status: Accepted
n = int(input())
P = list(map(int,input().split()))
ans = 0
mi = P[0]
for i in range(n):
    if P[i] <= mi:
        mi = P[i]
        ans += 1
print(ans)
# Judge status: Wrong Answer
import math
from functools import reduce

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

n = int(input())

answer = 0.0

for i in range(1,n+1):
  
  for j in range(1,n+1):
    
    for h in range(1,n+1):
      f = gcd(i,j,h)
      answer += f
      
print(answer)
# Judge status: Accepted
K, N = map(int, input().split())
house_list = list(map(int, input().split()))

saidai_kyori = 0
sou_kyori = 0
for i, position in enumerate(house_list):
    kyori = 0
    if i == 0:
        kyori = K + house_list[0] - house_list[-1]
    else:
        kyori = house_list[i] - house_list[i-1]

    if kyori > saidai_kyori:
        saidai_kyori = kyori
    
    sou_kyori += kyori

print(sou_kyori - saidai_kyori)
# Judge status: Accepted
n=int(input())

a_tmp=list(map(int,input().split()))
a=[]
for i in range(n):
    a.append([a_tmp[i],i+1])
a.sort(key=lambda x:x[0])

for i in range(n):
    print(a[i][1],end=" ")
# Judge status: Wrong Answer
n,k = map(int,input().split())
master = []
count = 0
for num in range(k):
    d = input()
    sunuke = list(map(int,input().split()))
    master+=sunuke

print(3-len(set(master)))
# Judge status: Wrong Answer
n = int(input())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
bl.append(0)

mons = 0
b0 = 0

for a, b in zip(al, bl):
    if a >= (b+b0):
        mons += (b+b0)
    else:
        mons += a
        b0 = b-(a-b0)

print(mons)
# Judge status: Accepted
n = int(input())
ans = [0] * 87
ans[0] = 2
ans[1] = 1
for i in range(2, n + 1):
    ans[i] = ans[i - 2] + ans[i - 1]
print(ans[n])
# Judge status: Wrong Answer
n = int(input())
v  = list(map(int, input().split()))
#h, w = list(map(int, input().split()))
v.sort()
ans = 0
point = (v[0]+v[1])/2
if n == 2:
    print(point)
else:
    for i in range(2, n):
        point = (point+v[i])/2

print(point)
# Judge status: Wrong Answer
x=int(input())
y=int(input())
z=int(input())
print((x+y)*z/2)
# Judge status: Wrong Answer
a,b = map(int,input().split())
num = input()

if len(num) == 8 and num[:3].isdecimal() and num[3]== "-" and num[4:].isdecimal():
	print("Yes")
else:
	print("No")
# Judge status: Accepted
import math
a,b=map(int,input().split())

print(int(math.ceil((a+b)/2)))
# Judge status: Accepted
x,y,z=list(map(int,input().split()))
print((x-z)//(y+z))
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    X, A, B = map(int, input().split())
    print('A'if abs(X - A) < abs(X - B)else 'B')


if __name__ == "__main__":
    main()
# Judge status: Accepted
l = a = [chr((ord("a") + i)) for i in range(26)]
print(l[l.index(input())-25])
# Judge status: Accepted
import math
n=int(input())
if int(math.ceil(n/1.08)*1.08)==n:
    print(math.ceil(n/1.08))
else:
    print(":(")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
if n < 3:
    print(1)
    exit(0)
cnt = 1

increase = a[1] - a[0];
for i in range(2, len(a)):
    new_inc = a[i] - a[i-1];
    if increase * new_inc < 0:
        cnt += 1
        increase = 0
    elif increase == 0:
        increase = new_inc
print(cnt)
# Judge status: Wrong Answer
s = input()
n = len(s)+1
ans = 0
ls = [0 for _ in range(n)]
rs = [0 for _ in range(n)]
for i in range(n-1):
    if s[i] == '<':
        ls[i+1] = ls[i]+1
for i in range(n-1):
    if s[i] == '>':
        rs[-2-i] = rs[-1-i]+1
for i,j in zip(ls,rs):
    ans += max(i,j)
print(ans)
# Judge status: Accepted
K, N = map(int, input().split())
A = list(map(int, input().split()))

diff = [A[0] + K-A[-1]]
for i in range(N-1):
  diff.append(A[i+1] - A[i])

print(K - max(diff))
# Judge status: Accepted
n,k = map(int,input().split())
lst = list(map(int,input().split()))

dp = [float('inf')]*n
dp[0] = 0
for i in range(1, min(k, len(lst))):
    dp[i] = abs(lst[i] - lst[0])
for i in range(k, n):
    for j in range(1, k+1):
        dp[i] = min(dp[i], dp[i-j]+abs(lst[i]-lst[i-j]))
print(dp[-1])
# Judge status: Accepted
n, m = map(int, input().split())
if n*2 >= m:
    ans = m//2
else:
    ans = n + (m-2*n)//4
print(ans)
# Judge status: Accepted
N, T = map(int, input().split())

res = 10 ** 9
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        res = min(res, c)

if res < 10 ** 9:
    print(res)
else:
    print("TLE")
# Judge status: Accepted
import math
x = int(input())
for i in range(x,0,-1):
    if math.sqrt(i)%1 == 0  or (math.ceil(i ** (1/3)))**3 == i or (math.ceil(i ** (1/5)))**5 == i:
        print(i)
        break
# Judge status: Accepted
mod = 10**9 + 7


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


A = [format(a, "060b")[::-1] for a in A]

answer = 0
for i in range(60):
    x, y = 0, 0
    for a in A:
        if a[i] == "0":
            x += 1
        else:
            y += 1
    answer += (x * y) * 2**i
    answer %= mod


print(answer)
# Judge status: Wrong Answer
from collections import Counter
N,M = map(int,input().split())
A = Counter(list(map(int,input().split())))
for i in range(M):
    b,c = map(int,input().split())
    if c in A.keys():
        A[c] += b
    else:
        A[c] = b
A = sorted(A.items(),reverse=True)
check = N
ans = 0
for i in A:
    if i[1]<check:
        check -= i[1]
        ans += (i[0] * i[1])
    else:
        ans += i[1] * check
        check = 0
print(ans)
# Judge status: Wrong Answer
def myfunc(op):
    if op == 1:
        return "+"
    else:
        return "-"


a, b, c, d = [int(i) for i in list(input())]

for j in range(8):
    op = [1, 1, 1]
    for i in range(3):
        if (j >> i) & 1:
            op[i] = -1
    if a + b * op[0] + c * op[1] + d * op[2] == 7:
        x = myfunc(op[0])
        y = myfunc(op[1])
        z = myfunc(op[2])
        print(f"{a}{x}{b}{y}{c}{z}{d}=7")
# Judge status: Accepted
print('bwuisnt'[eval(input().replace(*' +'))<22::2])
# Judge status: Accepted
K, N = map(int, input().split())
A = list(map(int, input().split()))
M = 0
for i in range(N-1):
  M = max(M, A[i+1] - A[i])
M = max(M, A[0] + K - A[-1])
print(K - M)
# Judge status: Wrong Answer
n = int(input())
t,a = map(int,input().split())
l = []
ans = []

l = list(map(int,input().split()))
    
for i in range(n):
    ans.append(a - t - (l[i] * 0.006))

print(ans.index(min(ans,key=abs))+1)
# Judge status: Accepted
s,w = map(int,input().split())
if s <= w:
    print("unsafe")
else:
    print("safe")
# Judge status: Accepted
import sys
input = sys.stdin.readline
from math import floor

def main():
    n = int(input())
    A = [int(input()) for _ in range(n)]

    x = 0
    for a in A:
        if a == 0:
            yield x // 2
            x = 0
        x += a

    yield x // 2


print(sum(main()))
# Judge status: Accepted
# -*- coding: utf-8 -*-
from collections import Counter

N = int(input().strip())
a_list = list(map(int, input().rstrip().split()))
#-----

cnt_dic = Counter(a_list)

cnt=0
for i,value in cnt_dic.items():
    if i == value:
        continue
    elif i > value:
        cnt += value
    elif i < value:
        cnt += (value - i)

print(cnt)
# Judge status: Accepted
D=int(input())
if D==25:
    print("Christmas")
elif D==24:
    print("Christmas Eve")
elif D==23:
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")
# Judge status: Wrong Answer
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))

for i in range(X+1,Y+1):
    if max(x)<i and min(y)<=i:
        print('No War')
        break
    elif i==Y:
        print('War')
# Judge status: Accepted
N, K = map(int, input().split())
D = [int(n) for n in input().split()]
ans = 10000000000

for i in range(N-K+1):
    L = D[i]
    R = D[i+K-1]
    LR = abs(L) + abs(L - R)
    RL = abs(R) + abs(R - L)
    ans = min(ans, min(LR, RL))

print(ans)
# Judge status: Accepted
N = int(input())

def checkDigit(n):
  a = n % 10
  n = (n-a)//10
  b = n % 10
  c = (n-b)//10
  if a == b and b == c:
    return True
  else:
    return False

for i in range(1000):
  if checkDigit(N):
    print(N)
    break
  N += 1
# Judge status: Accepted
from collections import Counter

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

# 長さと個数の辞書
length_num = Counter(A)
# 長い順からの長さのリスト
lengths = sorted(list(length_num.keys()), reverse=True)

ans = 0
sides = []

# 長い辺の順にループ
for l in lengths:
  if length_num[l] >= 4:
    ans = max(ans, l * l)
  if length_num[l] >= 2:
    sides.append(l)
  if len(sides) == 2:
    ans = max(ans, sides[0] * sides[1])
    break

print(ans)
# Judge status: Wrong Answer
N = input()

if N in '7':
  print('Yes')
else:
  print('No')
# Judge status: Accepted
X = int(input())
res = 0
for b in range(1, 33):
  for p in range(2, 10):
    if b ** p <= X:
      res = max(res, b ** p)
print(res)
# Judge status: Wrong Answer
a, b, c, x, y = map(int, input().split())

ans = 10**5
for i in range(10**5):
    tmp = 2*c*i + (x-i)*a + (y-i)*b
    ans = min(ans, tmp)
    if i >= x or i >= y:
        break
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
total = 1000
kabu = 0
 
for i in range(N-1):
    if (A[i] <= A[i+1]):
        kabu += total//A[i]
        total -= kabu*A[i]
    elif(A[i] >= A[i+1]):
        total += (kabu*A[i])
        kabu = 0
 
 
#最後
i += 1
total += (kabu * A[i])
kabu = 0
print(total)
# Judge status: Accepted
A, B, C = map(int, input().split())
if A <= C and C <= B:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
ans =1
mod = 10**9+7
for i in range(1, n+1):
	ans =((ans%mod)*(i%mod))%mod
	ans = ans%mod
print(ans)
# Judge status: Accepted
S, T = input(), input()
ans = 'No'
for i in range(len(S)):
  S = S[1:] + S[:1]
  if S == T:
    ans = 'Yes'

print(ans)
# Judge status: Accepted
s = input()
if s.count('a') and s.count('b') and s.count('c'):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())

if n<10:
  print('ABC00' + str(n) )
elif n<100:
  print('ABC0' + str(n))
elif n<1000:
  print('ABC' + str(n))
else:
  print('ABD' + str(n+1))
# Judge status: Accepted
import sys,math
input = sys.stdin.readline

def f(s):
    n = int(s)%2
    return n

N,P = list(map(int,input().split()))
A = list(map(f,input().split()))

c0 = A.count(0)
c1 = A.count(1)
fact = [1]* (c1+1)
for i in range(1,c1+1):
    fact[i]= fact[i-1]*i

cnt = 0
for i in range(P,c1+1,2):
    cnt += fact[c1]//fact[i]//fact[c1-i]

print(cnt*pow(2,c0))
# Judge status: Wrong Answer
n, k = map(int, input().split())
h = [int(input()) for i in range(n)]

h.sort()
height = []
for i in range(n - 1):
    height.append(h[i + 1] - h[i])
height.sort()
ans = 0
for j in range(k - 1):
    ans += height[j]
print(ans)
# Judge status: Accepted
Q, H, S, D = map(int, input().split())
L = int(input())
quantities = [(8*Q, 'Q'), (4*H, 'H'), (2*S, 'S'), (D, 'D')]
rest = {'Q': 4*Q, 'H': 2*H, 'S': S, 'D': D//2}
quantities.sort()
if quantities[0][1] == 'D' and L%2 != 0:
  print(L//2*D + rest[quantities[1][1]])
elif quantities[0][1] == 'D' and L%2 == 0:
  print(L//2*D)
else:
  print(L*rest[quantities[0][1]])
# Judge status: Accepted
N = int(input())
s = [int(input()) for _ in range(N)]

if sum(s) % 10:
  print(sum(s))
else:
  s2 = [i for i in s if i % 10]
  if s2:
    print(sum(s) - min(s2))
  else:
    print(0)
# Judge status: Accepted
# coding: utf-8

N, K, S = map(int, input().split())

if S < 10**9:
    for _ in range(K):
        print(S, end=" ")
    for _ in range(N-K-1):
        print(S+1, end=" ")
    if K != N:
        print(S+1)
else:
    for _ in range(K):
        print(S, end=" ")
    for _ in range(N-K-1):
        print(S-1, end=" ")
    if K != N:
        print(S-1)
# Judge status: Accepted
def solve(d,t,s):
    if d/s <= t:
        return "Yes"
    return "No"


d,t,s = map(int,input().split())
print(solve(d,t,s))
# Judge status: Accepted
from collections import Counter
def main():
    n = int(input())
    a = list(map(int, input().split()))
    ac = Counter(a)
    acl = [i for i in ac if ac[i] >= 2]
    acl.sort(reverse=True)

    if len(acl) == 0:
        print(0)
    elif ac[acl[0]] >= 4:
        print(int(acl[0] * acl[0]))
    elif len(acl) <= 1:
        print(0)
    else:
        print(int(acl[0]*acl[1]))

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

point = [0]*(10**5+2)

for i in a:
    if i == 1:
        point[1] += 1
        point[2] += 1
    else:
        point[i] += 1
        point[i-1] += 1
        point[i+1] += 1

print(max(point))
# Judge status: Accepted
import sys
import math

N = int(sys.stdin.readline().strip())
ABlist = []
for _ in range(N):
    a, b = map(int, sys.stdin.readline().strip().split())
    ABlist.append((a, b))

Asorted = sorted(ABlist)
Bsorted = sorted(ABlist, key=lambda x: x[1])
if N % 2 == 1:
    left = Asorted[N//2][0]
    right = Bsorted[N//2][1]
    # print(left, right)
    print(right - left + 1)
else:
    left = (Asorted[N//2 - 1][0] + Asorted[N//2][0]) / 2
    right = (Bsorted[N//2 - 1][1] + Bsorted[N//2][1]) / 2
    print(int((right - left) * 2 + 1))
# Judge status: Wrong Answer
n=int(input())
a=[list(map(str,input().split())) for i in range(n)]
# print(a)
# print(len(a[0][0]))
ans=[]
cnt=0
# print(a[0][0][0])
for i in range(len(a[0][0])):
    cnt=0
    for k in range(1,n):
        if (a[0][0][i] in a[k][0]):
            a[k][0].replace(a[0][0][i],"",1)
            cnt+=1
    if cnt==n-1:
        ans.append(a[0][0][i])
ans.sort()
res=''
for x in ans:
    res+=x
print(res)
# Judge status: Wrong Answer
d = int(input())

print("Christmas" + "Eve" *(25-d))
# Judge status: Accepted
def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    ans = A[0]
    if 0 in A:
        print(0)
        return

    for i in range(1, N):
        ans = ans * A[i]

        if ans > (10 ** 18):
            ans = -1
            break

    print(ans)


resolve()
# Judge status: Wrong Answer
s=int(input())
count=0
a=[0]*1000000
for i in range(1000000):
    if s%2==1:
        s=s*3+1
    else:
        s=s//2
    if s in a:
        print(i+2)
        break
    a[i]=s
# Judge status: Wrong Answer
s = input()
s = s.split('hi')
s = set(s)
if len(s) == 1:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n,m=map(int,input().split())


if n%2==1:
  for i in range(0,m):
    print(i+1,m-i)
else:
  lis1=[]
  lis2=[]
  for i in range(1,m+1):
    lis1.append(i)
    lis2.append(2*m+1-i)
  for k in range(0,len(lis1)):
    if k%2==1:
      print(lis1[k],lis2[-1-k])
    else:
      print(lis1[k],lis2[k])
# Judge status: Accepted
a,b=map(int,input().split()) #入力を改行ではなくてスペース1マスあける

x=(a+b)/2
if x%1==0:
    print(int(x))
else:
    print(int(x)+1)
# Judge status: Accepted
from functools import reduce

def mycmb(n,r,p):
    r = min(r,n-r)
    if r == 0:
        return 1
    over = reduce(lambda x,y:x*y%p,range(n,n-r,-1))
    under = reduce(lambda x,y:x*y%p,range(1,r+1))
    return (over * pow(under,p-2,p))%p


mod = 10**9+7

x,y = map(int, input().split())
n = (2*x-y) // 3
m = (2*y-x) //3

if (x+y) % 3 != 0:
    print(0)
    exit()

if n < 0 or m < 0:
    print(0)
    exit()

print(mycmb(n+m,n,mod))
# Judge status: Accepted
N,M=map(int,input().split())
A=[input() for i in range(N)]
B=[input() for i in range(M)]
def F(a,b):
  for k in range(M):
    for l in range(M):
      if A[a+l][b+k]!=B[l][k]:
        return False
  return True
  
for i in range(N-M+1):
  for j in range(N-M+1):
    if F(i,j):
      print('Yes')
      exit()
print('No')
# Judge status: Accepted
n,k = map(int, raw_input().split())
ais = map(int, raw_input().split())

def p(m,ais,k):
	t = [ m, ais, k]
	for ai in ais:
		if ai > m:
			k-= ai / m
	return k >=0

lo,hi = 1, max(ais)

while(lo < hi):
	med = (lo + hi)/2
	if p(med, ais, k):
		hi = med
	else:
		lo = med + 1

print lo
# Judge status: Accepted
d=int(input())
if d==25:
  print("Christmas")
elif d==24:
  print("Christmas Eve")
elif d==23:
  print("Christmas Eve Eve")
elif d==22:
  print("Christmas Eve Eve Eve")
# Judge status: Wrong Answer
l, r = map(int, input().split())
l, r = l%2019, r%2019

ans = 2019
for i in range(l, r):
    for j in range(i+1, r+1):
            ans = min(ans, (i*j)%2019)
print(ans)
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))
A=[a for a in A if a<3200]
free=n-len(A)
A=set(map(lambda x: x//400,A))
print(max(1,len(A)),len(A)+free)
# Judge status: Accepted
N, K = map(int, input().split())
H = list(sorted(list(map(int, input().split())), reverse=True))
ans = 0
for h in H[K:]:
    ans += h
print(ans)
# Judge status: Wrong Answer
n=int(input())
v=sorted(list(map(int,input().split())))
ans=v[0]
for i in range(n-1):
    ans=(ans+v[i+1])//2
print(ans)
# Judge status: Accepted
w = input()

for a in [chr(ord("a")+i) for i in range(26)]:
  if w.count(a) % 2 == 1:
    print("No")
    exit()
    
print("Yes")