peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
#ABC079-C-Train Ticket
s = input()

n = len(s) - 1

for i in range(n**2):
    tmp = ""
    for j in range(n+1):
        tmp += s[j]
        
        if (i >> j)&1 :
            tmp += '+'
        else:
            tmp += '-'
            
    tmp = tmp[:-1]
    
    if eval(tmp) == 7:
        print(tmp+'=7')
        break
# Judge status: Accepted
a, b = map(int, input().split())
if a%3 == 0:
    print('Possible')
elif b%3 == 0:
    print('Possible')
elif (a+b)%3 == 0:
    print('Possible')
else:
    print('Impossible')
# Judge status: Accepted
n=int(input())
if n%1000:print(1000-(n%1000))
else:print(0)
# Judge status: Accepted
n = int(input())
  
if(n%9==0):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
def luc(a, b, n):
    if n > 0:
        print(a,b)
        return luc(b,a+b,n-1)
    else:
        return a
print(luc(2,1,n))
# Judge status: Accepted
N=int(input())
A=[int(input()) for i in range(N)]
ans=0
for i in range(N):
    ans+=A[i]//2
    A[i]-=(A[i]//2*2)
    if i>0:
        d=min(A[i],A[i-1])
        ans+=d
        A[i]-=d
        A[i-1]-=d
    if i<N-1:
        d=min(A[i],A[i+1])
        ans+=d
        A[i]-=d
        A[i+1]-=d
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())

students = [list(map(int, input().split())) for _ in range(n)]
checks = [list(map(int, input().split())) for _ in range(m)]

for s in students:
    dis = [abs(s[0] - c[0]) + abs(s[1] - c[1]) for c in checks]
    print(dis.index(min(dis))+1)
# Judge status: Wrong Answer
s = input()

for i in range(len(s)):
  if s[i] == "A":
    a = i
  elif s[i] == "Z":
    b = i

print(b-a+1)
# Judge status: Accepted
n = int(input())
ans = []
for i in range(1, n+1):
    cnt = 0
    if i%2==1:
        for j in range(1, i+1):
            if i%j==0:
                cnt += 1
    if cnt==8:
        ans.append(i)

print(len(ans))
# Judge status: Accepted
S = input()
a = S[0:2]
b = S[2:4]
A = int(a)
B = int(b)
if A>=1 and A <=12:
  if B>= 1 and B <= 12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if B>= 1 and B<= 12:
    print("YYMM")
  else:
    print("NA")
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    mod = 10**9+7
    print(pow(10,n,mod)-2*pow(9,n,mod)+pow(8,n,mod))

if __name__=='__main__':
    main()
# Judge status: Wrong Answer
import numpy as np
import math
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()

a, b, x = imap()
ans = math.floor(b/x) - math.floor(a/x)
if a % x == 0: ans += 1
print(ans)
# Judge status: Accepted
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

s=input()

key = "keyence"

for i in range(len(s)):
    j = i + len(s) -7
    if s[:i] + s[j:] == key:
        print("YES")
        exit()
print("NO")
# Judge status: Wrong Answer
n = int(input())
C = list(input())

if "R" not in C:
    print(n)
    exit()

W = C.count("W")
R = C.count("R")
w = 0
r = R
ans = float('inf')

for c in C:
    if c == "W":
        w += 1
    else:
        r -= 1
    ans = min(ans, max(w, r))
print(ans)
# Judge status: Accepted
n = int(input())
print(int(n + n**2 + n**3))
# Judge status: Wrong Answer
K, A, B = map(int, input().split())

if A + 2 >= B:
    print(K)
elif K <= A:
    print(K)
else:
    M = K - A + 1
    ans = A + M // 2 * (B - A) + M % 2
    print(ans)
# Judge status: Accepted
S = input()
if len(set(S)) == 3:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

d = {}
for i in a:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1

ans = sum(a)
q = int(input())

for i in range(q):
    b,c = map(int,input().split())
    if b in d:
        ans -= b * d[b]
        ans += c * d[b]
        if c in d:
            d[c] += d[b]
        else:
            d[c] = d[b]
        d[b] = 0
    print(ans)
# Judge status: Wrong Answer
# -*- coding: <encoding name> -*-

n = int(input())
l = list(map(int, input().split()))
s = sum(l)
print('Yes' if n < s else 'No')
# Judge status: Accepted
w = list(map(str, input()))
ans = 'Yes'
for i in (set(w)):
    if w.count(i)%2!=0: ans ='No'
print(ans)
# Judge status: Accepted
def resolve():
    input()
    A = list(map(int,input().split()))
    count=0
    while len(list(filter(lambda x: x%2==1,A)))==0:
        count+=1
        A =list(map(lambda x:x//2,A))
    print(count)
resolve()
# Judge status: Wrong Answer
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
a,b,c,d=get_ints()
x=max(a,b)
y=max(c,d)
print(x*y)
# Judge status: Accepted
s = list(input())
import collections
c = collections.Counter(s)
ans = 1
for i in range(4):
    if c[s[i]] != 2:
        ans = 0
print(["No","Yes"][ans])
# Judge status: Accepted
N = int(input())
a = [int(i) for i in input().split()]
ls = [0 for i in range(N+1)]
for i, x in enumerate(a[::-1]):
    num = N - i
    s = 0
    for j in range(num, N+1, num):
        if ls[j] == 1:
            s += 1
    if s%2 == x:
        ls[num] = 0
    else:
        ls[num] = 1
print(sum(ls))
b = []
for i in range(N+1):
    if ls[i] == 1:
        b.append(i)
print(*b)
# Judge status: Accepted
s=int(input())
mod=10**9+7
if s<=2:
  print(0)
  exit()
if s==3:
  print(1)
  exit()
dp=[0]*(s+1)
for i in range(3,s+1):
  dp[i]+=1
  for j in range(3,s+1):
    if i+j>s:
      continue
    dp[i+j]+=dp[i]
    dp[i+j]%=mod
  dp[i]%=mod
print(dp[-1]%mod)
# Judge status: Wrong Answer
n=int(input())
a=list(map(lambda x:int(x)//400,input().split()))
cat=[0]*9
for ai in a:
    if ai < 8:
        cat[ai]=1
    else:
        cat[8]+=1
print(str(max(sum(cat[:8]),1))+' '+str(min(sum(cat),8)))
# Judge status: Accepted
N = str(input())
Sta = 753
Ans = 1000

for i in range(len(N)-2):
    C_Ans = abs(Sta-int("".join(N[i:i+3])))
    if C_Ans < Ans:
        Ans = C_Ans

print(Ans)
# Judge status: Accepted
#20　AtCoder Beginner Contest 077 C - Snuke Festival
import bisect
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
c.sort()
ans = 0
for i in b:
    ans+= (bisect.bisect_right(a, i-1))*(n-bisect.bisect_left(c, i+1))
print(ans)
# Judge status: Accepted
import sys
import numpy as np

A = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(A):
    s = str(input())
    if s == 'AC':
        AC += 1
    elif s == 'WA':
        WA += 1
    elif s == 'TLE':
        TLE += 1
    elif s == 'RE':
        RE += 1

print('AC x', AC)
print('WA x', WA)
print('TLE x', TLE)
print('RE x', RE)
# Judge status: Accepted
n, a, b = map(int, input().split())
mod = 10**9 + 7


def neko(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    k = min(n - k, k)
    ans = 1
    inv = [1] * (k + 1)
    if k >= 1:
        ans *= (n - k + 1) % mod
    for i in range(2, k + 1):
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        ans = ans * (n - k + i) * inv[i] % mod
    return ans


print((pow(2, n, mod) - 1 - neko(n, a) - neko(n, b)) % mod)
# Judge status: Wrong Answer
L, R = list(map(int, input().split()))
l = L%2019
print(l * (l+1) % 2019)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print('YES' if a <= c <=b else 'NO')
# Judge status: Accepted
n = int(input())
l = [list(map(int, input().split())) for i in range(n - 1)]

for i in range(n):
    t = 0
    for c, s, f in l[i:]:
        t = max(s, t)
        mod = abs(t - s)%f
        if mod != 0:
            t += f - mod
        t += c
    print(t)
# Judge status: Accepted
A,B = map(int,input().split())
count = 0
 
for i in range(A,B+1):
  i = str(i)
  if i[0] == i[4] and i[1] == i[3]:
    count += 1
    
print(count)
# Judge status: Accepted
import fractions
from functools import reduce

n, x = map(int, input().split())
xx = [abs(int(i) - x) for i in input().split()]

if n == 1:
    ans = xx[0]
else:
    ans = reduce(fractions.gcd, xx)

print(ans)
# Judge status: Wrong Answer
N,W=map(int,input().split())
k=[[0,0] for i in range(N)]
dp=[[0]*(W+1) for j in range(N+1)]
for i in range(N):
    k[i][0],k[i][1]=map(int,input().split())



for i in range(N):
    for w in range(W+1):
        if k[i][0]>w:
            dp[i+1][w]=dp[i][w]
        else:
            dp[i+1][w] = max(dp[i][w-k[i][0]]+k[i][1],dp[i][w])


print(dp[N-1][W])
# Judge status: Accepted
def resolve():
    '''
    code here
    '''
    N, M, Q = [int(item) for item in input().split()]
    As = [int(input()) for _ in range(Q)]

    memo = [0 for _ in range(N)]

    for item in As:
        memo[item-1] += 1

    for item in range(N):
        if M - Q + memo[item] > 0:
            print('Yes')
        else:
            print('No')


if __name__ == "__main__":
    resolve()
# Judge status: Accepted
n, m = map(int, input().split())
k = []
tmp = [0] * m
for i in range(n):
    k.append(list(map(int, input().split())))
    k[i].pop(0)
ans = 0
cnt = 0
for i in k:
    for j in i:
        tmp[j-1] += 1

for i in tmp:
    if i == n:
        ans += 1
print(ans)
# Judge status: Wrong Answer
import math


def recta():
    r = int(input())
    area1 = r**2 * math.pi
    area2 = 1**2 * math.pi
    print(int(area1 / area2))


if __name__ == "__main__":
    recta()
# Judge status: Wrong Answer
def solve():
    n, m = map(int, input().split())
    if n == 1 and m == 1:
        print(0)
    elif n == 1:
        print(m-2)
    else:
        print((n-2)*(m-2))
    return 0

if __name__ == "__main__":
    solve()
# Judge status: Wrong Answer
N, K = map(int, input().split())
R, S, P = list(map(int, input().split()))
T = list(input())

result = [0] * N
for i,t in enumerate(T):
    if t == "r":
        result[i] = P
    elif t == "s":
        result[i] = R
    else:
        result[i] = S

for i in range(K, N):
    if result[i] == result[i-K]:
        result[i] = 0

print(sum(result))
# Judge status: Accepted
a, b = map(int, input().split())
if (a+b)%2 == 0:
  print((a+b)//2)
else:
  print((a+b)//2 + 1)
# Judge status: Accepted
import sys
input = sys.stdin.readline
N=int(input())
lst=[[] for f in range(N)]
ans=[[0 for e in range(3)] for f in range(N)]
for i in range(N):
 lst[i]=list(map(int,input().split()))
ans[0][0]=lst[0][0]
ans[0][1]=lst[0][1]
ans[0][2]=lst[0][2]
if N>1 :
 for i in range(1,N):
  ans[i][0]=max(ans[i-1][1],ans[i-1][2])+lst[i][0]
  ans[i][1]=max(ans[i-1][0],ans[i-1][2])+lst[i][1]
  ans[i][2]=max(ans[i-1][1],ans[i-1][0])+lst[i][2]
print(max(ans[N-1]))
# Judge status: Accepted
import collections

n = int(input())
a = input()
ans = 1
mod = 10**9+7
a = collections.Counter(a)
for v in a.values():
    ans *= (v+1) % mod
print((ans-1) % mod)
# Judge status: Accepted
from collections import deque

def main():
    N = int(input())
    l = deque()
    mozi = list("abcdefghijklmnopqrstuvwxyz")
    a, b = divmod(N, 26)
    N -= 1

    while True:
        a, b = divmod(N, 26)
        l.appendleft(mozi[b])
        N = a
        N -= 1
        if a == 0:
            break

    print("".join(l))


main()
# Judge status: Accepted
x,y,z = map(int,input().split())
a = x-z
b = a//(y+z)
print(b)
# Judge status: Accepted
i=list(input())
if(i[0]==i[1] or i[1]==i[2] or i[2]==i[3]):
    print("Bad")
else:
    print("Good")
# Judge status: Wrong Answer
import numpy as np
from functools import reduce

def gcd1(m, n):
    r = m % n
    return gcd1(n, r) if r else n
def lcm1(m, n):
    return m//gcd1(m, n)*n
def lcm(numbers):
    return reduce(lcm1, numbers, 1)

MOD = 10**9+7
n = int(input())
a = np.array(list(map(int, input().split())))
l = lcm(a)
ans = 0
for x in a:
    ans = (ans + l//x)%MOD
print(ans)
# Judge status: Wrong Answer
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    A =[]
    A.append(int(input()))


    A.append(int(input()))

    A.append(int(input()))

    A.append(int(input()))

    A.append(int(input()))

    k = int(input())

    for i in range(4):
        if A[i+1] -A[i] >k:
            print(":(")
            exit(            )

    print("Yay!")

if __name__ == "__main__":
    main()
# Judge status: Accepted
import collections
n = int(input())
s=input()
l=list(collections.Counter(s).values())
if len(l) == 3:
    ans=l[0]*l[1]*l[2]
    for i in range(n):
        for j in range(i+1,n):
            k = 2*j-i
            if n <= k:
                break
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
                ans-=1
    print(ans)
else:
    print(0)
# Judge status: Accepted
s=input()
w=["Sunny","Cloudy","Rainy","Sunny"]
print(w[w.index(s)+1])
# Judge status: Wrong Answer
n=int(input())
from itertools import accumulate
a=[0]*(n+1)
for i in range(n+1):
    a[i]=i

ac=list(accumulate(a))

for i in range(n+1):
    if ac[i]+a[i+1]>=n:
        print(a[i+1])
        exit()
# Judge status: Wrong Answer
#A
n = int(input())

if n == 1:
    print(float(1))
elif n % 2 != 0:
    print(float(3/5))
else:
    print(float(1/2))
# Judge status: Accepted
x,y,z=map(int,input().split())
n=0
while True:
  if n*y+(n+1)*z>x:
    print(n-1)
    exit()
  n+=1
# Judge status: Accepted
K, X = map(int, input().split())

ans = []

for i in range(-K+1,K) :
    ans.append(str(X+i))

print(" ".join(ans))
# Judge status: Wrong Answer
n = int(input())
a = []
for i in range(n):
    s = int(input())
    a.append(s)
a.sort()
i = 0
cnt = 0
while i < n:
    j = i+1
    chk = 0
    if j >= n:
        cnt += 1 
        break
    while a[i] == a[j]:
        chk += 1
        j += 1
        if j >= n:
            break
    if chk%2 == 1:
        cnt += 1 
    i = j
print(cnt)
# Judge status: Accepted
import collections
import heapq
import math
import random
import sys
input = sys.stdin.readline
sys.setrecursionlimit(500005)
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
rs = lambda: input().rstrip()

n = ri()
a = rl()
N = 1000000
f = [0] * (N + 10)
for v in a:
    f[v] += 1
for i in range(N, 0, -1):
    if f[i] == 0:
        continue
    j = i * 2
    while j <= N:
        f[j] += f[i]
        j += i
cnt = sum(f[i] == 1 for i in a)
print(cnt)
# Judge status: Accepted
n, m = map(int, input().split())

a = n * (n - 1) // 2
b = m * (m - 1) // 2

print(a + b)
# Judge status: Wrong Answer
N = int(input())
power_list = list(map(int, input().split()))

print(sum(sorted(power_list)[N:2*N]))
# Judge status: Wrong Answer
n,k = map(int,input().split())
R,S,P = map(int,input().split())
points = {'r':P,'s':R,'p':S}
l = list(input())
ans = 0
for i,j in enumerate(l):
  if (i-k<=0) or l[i] != l[i-k]:
    ans += points[j]

print(ans)
# Judge status: Accepted
# coding: utf-8
    
def main():
    N = int(input())
    S = input()[:N]

    min_count = count = S[1:].count('E')
    for i in range(1, N):
        if S[i - 1] == 'W':
            count += 1
        if S[i] == 'E':
            count -= 1
            if count < min_count:
                min_count = count

    print(min_count)

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

q = int(input())

m = {}

for i in range(1000000):
  m[i] = 0

for e in a:
  m[e] += 1
  
ans = sum(a)

for i in range(q):
  b,q = map(int,input().split())
  diff = (q-b) * m[b]
  
  m[q] += m[b]
  m[b] = 0
  
  ans += diff
  print(ans)
# Judge status: Wrong Answer
n = int(input())
l = input().split(" ")
for i in range(len(l)):
    l[i] = int(l[i])

l.sort()
sum = 0
for i in range(1, n):
    sum += l[i]

if sum >= l[0]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from math import factorial

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

if abs(N - M) > 1:
    print(0)
else:
    print(factorial(N) * factorial(M) * (2 if N == M else 1) % (10**9+7))
# Judge status: Accepted
k, x = map(int, input().split())

apple = []
for i in range((x - k) + 1, (x + k)):
    apple.append(i)

print(*apple)
# Judge status: Accepted
n,h = map(int,input().split())
s1 = []
s2 = []
for _ in range(n):
  a, b = map(int,input().split())
  s1.append(a)
  s2.append(b)
maxa = max(s1)
s2.sort(key=lambda x:-x)
ans = 0
for s2i in s2:
  if s2i > maxa:
    ans += 1
    h -= s2i
  if h <= 0:
    break
if h > 0:
  if h % maxa == 0:
    ans += h // maxa
  else:
    ans += h // maxa + 1
  print(ans)
else:
  print(ans)
# Judge status: Accepted
s = input()
answer = ''
for _ in range(len(s)):
    answer += 'x'
print(answer)
# Judge status: Wrong Answer
import math
A,B = list(map(int,input().split()))
def problem_gksn(A, B):
  x_min = A / (0.08)
  x_max = (A+1)/0.08
  y_min = B / (0.10)
  y_max = (B+1) / (0.10)
  # print(x_min,x_max,y_min,y_max)
  if max(x_min, y_min) <= min(x_max, y_max):
    return math.ceil(max(x_min, y_min))
  else:
    return -1
print(problem_gksn(A,B))
# Judge status: Wrong Answer
import numpy as np
 
N,Max_W = map(int,input().split())
 
dp = [0 for _ in range(Max_W + 1)]
dp = np.array(dp)
 
for i in range(N):
    w,v = map(int,input().split())
    a = dp[:-w] + v
    b = dp[w:]
    m = np.maximum(a,b)
    dp[w:] = m
# Judge status: Accepted
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

dic = {}
ans = 0

for i in range(N):
    if not s[i] in dic:
        dic[s[i]] = 0
    dic[s[i]] += 1

for v in dic.values():
    ans += v*(v-1)//2

print(ans)
# Judge status: Wrong Answer
t = input()
print(t[0],end="")
for i in range(1,len(t)):
    if t[i] == "?":
        if t[i-1] == "D":
            print("P",end="")
        else:
            print("D",end="")
    else:
        print(t[i],end="")
# Judge status: Accepted
x = int(input())
if [7,5,3].count(x) > 0:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
r, g, b = map(int, input().split())
x = 100 * r + 10 * g + b

if x % 4 == 0:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
def main():
    def gcd(a,b):
        while b!=0:
            a, b = b, a%b
        return a

    def lcm(a,b):
        return a*b // gcd(a,b)

    N = int(input())
    T = [int(input()) for _ in range(N)]
    ans = 1
    for t in T:
        ans = lcm(ans, t)
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
i=input().split()
a=i[0]
b=i[1]
c=i[2]
if(a==b and b==c):
 print("Yes")
else:
 print("No")
# Judge status: Wrong Answer
n = int(input())
for i in range(1,10):
    if 1 <= n%i <= 9 and (n/i).is_integer():
        print('Yes')
        exit()
print('No')
# Judge status: Wrong Answer
X=input()
Y=int(X)
if Y<=99:
    print(0)

else:
    a=10*int(X[-2])+int(X[-1])
    b=a//5
    if a%5!=0:
        b+=1
    if b>Y//100:
        print(0)
    else:
        print(1)
    print(b)
    print(Y//100)
# Judge status: Accepted
a,b,c=map(int,input().split())
if (a==7 and b==5 and c==5) or (a==5 and b==7 and c==5) or (a==5 and b==5 and c==7):
  print("YES")
else:
  print("NO")
# Judge status: Accepted
def mainusbin(num):
    base = -2
    dst = ""
    i = 0
    if abs(base) > abs(num):
        return num
    while abs(base**i) <= abs(num):
        i += 1
        amari = num % base**i
        if amari:
            dst = "1" + dst
            num -= base**(i-1)
        else:
            dst = "0" + dst
    return dst
src = int(input())
dst = mainusbin(src)
print(dst)
# Judge status: Wrong Answer
print("YNeos"[max(int(input())//30,0):5:2])
# Judge status: Accepted
n = int(input())
s = input()
t = input()
p = n * 2

for i in range(n):
    if t[0:i+1] in s:
        p -= 1
    else:
        break

print(p)
# Judge status: Wrong Answer
n = input()
a_list = list(map(int, input().split()))
score = 0

for i in range(len(a_list) - 1):
  if a_list[i] < a_list[i+1]:
    score += a_list[i+1] - a_list[i]
    
print(score)
# Judge status: Accepted
n, m = map(int, input().split())
ans1 = n * (n - 1) // 2
ans2 = m * (m - 1) // 2
print(ans1 + ans2)
# Judge status: Accepted
S = input()
l = S[:2]
r = S[2:]
 
lcnt = 0
rcnt = 0
if 0 < int(l) <= 12:
    lcnt = 1
if  0 < int(r) <= 12:
    rcnt = 1
if lcnt and rcnt:
    print('AMBIGUOUS')
    exit()
elif lcnt:
    print('MMYY')
    exit()
elif rcnt:
    print('YYMM')
    exit()
else:
    print('NA')
# Judge status: Wrong Answer
N, x = map(int,input().split())
a = list(map(int,input().split()))
b = [a[i] + a[i+1] for i in range(N-1)]
ans = 0
for i in range(N-1):
    if b[i] > x:
        temp = b[i] - x
        ans += temp
        b[i] = x
        if i != N-2:
            b[i+1] -= temp
print(ans)
# Judge status: Wrong Answer
N=int(input())
X=list(map(int, input().split()))
XX = sorted(X)
mid = (XX[N//2-1] + XX[N//2])/2 
for i in range(N):
  if X[i] < mid:
    print(X[ N//2 ])
  else:
    print(X[N//2-1])
# Judge status: Wrong Answer
A, B = map(int, input().split())
print('Possible' if not A + B % 3 else 'Impossible')
# Judge status: Wrong Answer
import fileinput

lines = list(fileinput.input())

print(lines)
# Judge status: Accepted
import math
X = int(input())

#6565が最小になるはず
x = X//11
amari = X%11

ans = x*2+math.ceil(amari/6)
print(ans)
# Judge status: Wrong Answer
n = int(input())
l = sorted(list(map(int, input().split())), reverse = True)
ans = 0
for i in range(n // 2):
    ans += l[i] - l[n - 1 - i]
if n & 1:
    ans += l[n // 2]
print(ans)
# Judge status: Wrong Answer
N = int(input())
i = 0
total = 0
while True:
    total += i
    if total >= N:
        tmp = i
        break
    i += 1

for j in range(tmp, 0, -1):
    if N - tmp >= 0:
        N -= tmp
    if N == 0:
        break
    tmp -= 1
# Judge status: Accepted
n = int(input()) - 1

ans = 0

for i in range(1, n + 1):
  ans += int(n/i)
  
print(ans)
# Judge status: Accepted
n = int(input())

abc = list('abcdefghijk')


def solve(ans):
    if len(ans) == n:
        print(*ans, sep='')
    else:
        idx = max([abc.index(ans[i]) for i in range(len(ans))])
        for i in range(idx+2):
            nans = ans + [abc[i]]
            solve(nans)


solve(['a'])
# Judge status: Accepted
a,b,c,d = input()
if a==b==c or b==c==d:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
from collections import defaultdict
def solve():
  N, M = map(int, input().split())
  d = defaultdict(lambda: -1)
  for i in range(M):
    x,y = map(int, input().split())
    if d[x]>=0 and d[x]!=y:
      return -1
    if N>1 and x==1 and y==0:
      return -1
    d[x] = y
  if N==1 and d[1]==-1:
    return 0
  if d[1]==-1:
    d[1] = 1
  for i in range(2,N+1):
    if d[i]==-1:
      d[i] = 0
  ans = ''
  for i in range(1,N+1):
    ans += str(d[i])
  return ans
print(solve())
# Judge status: Accepted
a, b, c = map(int, input().split())
if b-a == c-b:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
w,h,n=map(int,input().split())
b=w
c=h
d=0
e=0
for i in range(n):
  x,y,a=map(int,input().split())
  if a==1:
    d=max(x,d)
  elif a==2:
    b=min(x,b)
  elif a==3:
    e=max(y,e)
  elif a==4:
    c=min(y,c)
if b<d or c<e:
  print(0)
else:
  print((b-d)*(c-e))
# Judge status: Accepted
import math
N = int(input())
carry = [int(input()) for _ in range(5)]
print(math.ceil(N / min(carry))+4)
# Judge status: Wrong Answer
#!/usr/bin/env python

n = int(input())
a = [0 for _ in range(n)]
b = [0 for _ in range(n)]
for i in range(n):
    a[i], b[i] = map(int, input().split())

ans = 0 

for i in reversed(range(n)):
    if a[i]%b[i] == 0:
        continue
    else:
        ans += (a[i]//b[i]+1)*b[i]-a[i]
    if i!=0:
        a[i-1] += ans 

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

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

total = sum(stick)
mid = total // 2

cum = 0
midi = 0
for i, block in enumerate(stick):
    cum += block
    if cum >= mid:
        midi = i
        break

l1 = sum(stick[:midi])
r1 = sum(stick[midi:])
diff1 = abs(l1 - r1)
 
l2 = l1 + stick[midi]
r2 = r1 - stick[midi]
diff2 = abs(l2 - r2)
 
print(min(diff1, diff2))
# Judge status: Wrong Answer
n,m=map(int,input().split())
f=[0]*(m+1)
count=0
for i in range(n):
  a=list(map(int,input().split()))
  k=a[0]
  a=a[1:]
  for i in range(k):
    f[a[i]]+=1
    
for i in range(m):
  if f[i]==n:
    count+=1
    
print(count)