peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
def resolve():
    '''
    code here
    '''
    a,b = [int(item) for item in input().split()]

    if a > 0:
        print('Positive')
    else:
        if a <= 0 and 0 <= b:
            print('zero')
        else:
            cnt = b - a + 1

            if cnt % 2 == 0:
                print('Posivite')
            else:
                print('Negative')

if __name__ == "__main__":
    resolve()
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    S = int(input())
    M = 10**9
    if S % M == 0:
        print(0,0,M,0,0,S//M)
    else:
        X = (S+M-1) // M
        a,b,c,d = M,1,M-S%M,X
        print(0,0,a,b,c,d)
        # print(a*d-b*c,S)

if __name__ == "__main__":
    main()
# Judge status: Accepted
s = str(input())
s = "2018/01" + s[7:10]
print(s)
# Judge status: Wrong Answer
a,b=map(int,input().split())
d = list(map(int, input().split(" ")))
w = [0]*len(d)

# 累積和の計算
w[0] = d[0]
for i in range(1, len(d)):
  w[i] = w[i-1] + d[i]

ans = 0
for i in range(a-b):
    ans = max([ans,w[i+b]-w[i]])
d2 = 0.5*b + ans/2

print(d2)
# Judge status: Accepted
def solve():
  N, C, K = map(int, input().split())
  ans = 1
  cnt = 0
  T = [int(input()) for _ in range(N)]
  T.sort()
  for i in range(N):
    if i==0:
      now = T[i]
    cnt += 1
    if now+K<T[i] or cnt>C:
      ans += 1
      cnt = 1
      if i<N-1:
        now = T[i]
  return ans
print(solve())
# Judge status: Accepted
a = [int(x) for x in input().split()]
a.sort()
if a[0] == a[1] == a[2]: print("No")
elif a[0] == a[1] or a[1] == a[2]: print("Yes")
else: print("No")
# Judge status: Accepted
n, m = map(int, input().split())
food = {i+1 for i in range(m)}

for i in range(n):
    k, *l = map(int, input().split())
    food = set(l) & food

print(len(food))
# Judge status: Accepted
N,X = map(int,input().split(' '))
num_list = list(map(int,input().split(' ')))
num_list_s = sorted(num_list)
total = 0
index = 0
for i in range(N):
    total += num_list_s[i]
    if total > X:
        break
    else:
        index += 1
if sum(num_list) < X:
    print(index-1)
else:
    print(index)
# Judge status: Accepted
import math
X = int(input())
ans = 1
Y = math.floor(math.sqrt(X))
for i in range(2, Y+1):
    for j in range(2, 10):
        a = i**j
        if a <= X:
            ans = max(ans, a)
print(ans)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(N):
    xor = 0
    for j in range(N):
        if i == j:
            xor ^= a[j]
    ans.append(xor)
print(*ans)
# Judge status: Accepted
import numpy as np
n,d = map(int,input().split())
arr = np.zeros((n,d))
for i in range(n):
    arr[i,:] = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(i+1,n):
        l = np.sum((arr[i,:] - arr[j,:])**2)**0.5
        if l.is_integer():
            ans+=1
print(ans)
# Judge status: Accepted
X=int(input())

for i in range(1,180):
    if (i*360%X==0):
        print((i*360)//X)
        exit()
# Judge status: Wrong Answer
import sys, math
from functools import lru_cache
from collections import deque
sys.setrecursionlimit(10**9)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

S = input()

def g(i):
    if i == 0:
        return 0

    if i < 2:
        return 1

    if S[i] != S[i-1]:
        return g(i-1)+1

    return g(i-3)+2

print(g(len(S)-1))
# Judge status: Wrong Answer
x = int(input())
print(x % 11)
if x % 11 == 0:
    print(x // 11 * 2)
elif x % 11 <= 6:
    print(x // 11 * 2 + 1)
else:
    print(x // 11 * 2 + 2)
# Judge status: Accepted
n = int(input())
s = sorted([int(input()) for _ in range(n)])
a = sum(s)
if a %10:
    print(a)
    exit()
for i in range(n):
    b = a - s[i]
    if b%10:
        print(b)
        break
else:
    print(0)
# Judge status: Wrong Answer
def main():
    n, m = map(int, input().strip().split())
    h = list(map(int, input().strip().split()))

    flg = [True] * n

    for i in range(m):
        a, b = map(int, input().strip().split())
        if(h[a-1]<h[b-1]):
            flg[a-1] = False
        elif(h[a-1]<h[b-1]):
            flg[b-1] = False
        else:
            flg[a-1] = False
            flg[b-1] = False

    print(flg.count(True))

main()
# Judge status: Accepted

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

from collections import Counter

ans = []

for (key, value) in Counter(A).items():
  if value >=2:
    ans.append(key)
  if value >= 4:
    ans.append(key)

if len(ans) <= 1:
  print(0)
else:
  ans = sorted(ans, reverse=True)
  print(ans[0] * ans[1])
# Judge status: Wrong Answer
a,b=map(int,input().split())
s=input()
print(s)
if s[a]!="-":
    print("No")
    #print(1)
elif s.count("-")>1:
    print("No")
    #print(2)
else:
    s=s.replace("-","")
    #print(3)
    #print(s)
    if s.isdigit()==True:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
import sys
input=sys.stdin.readline

n,k=map(int,input().split())
lst=[0]*100001

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

for i in range(100001):
    k-=lst[i]
    if k<=0:
        print(i)
        break
# Judge status: Accepted
a = list(map(int, input().split()))

s = set(a)

if len(s) == 2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import random

D = int(input())
c_list = list(map(int, input().split()))
for i in range(D):
    S_list = list(map(int, input().split()))
for i in range(D):
    print(random.randint(1,26))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

index = 1
cnt = 0
for i in range(len(a)):
  if a[i] != index:
    cnt +=1
  else:
    index +=1
    
if min(a)!=1:
  print("-1")
else:
  print(cnt)
# Judge status: Accepted
N, M, X, Y = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x_max = max(x)
y_min = min(y)
ans = 'War'
for i in range(-100,101):
    if (X < i <= Y ) and (x_max < i <= y_min):
        ans = 'No War'
print(ans)
# Judge status: Wrong Answer
s = 'HASFJGHOGAKZZFEGA'
rs = s[::-1]
x = s.index('A')
y = rs.index('Z')
print(len(s)-y-x)
# 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
ABC = sorted(map(int, input().split()))
K = int(input())

print(ABC[0] + ABC[1] + ABC[2] * K**2)
# Judge status: Wrong Answer
S = input()
weather = ["Sunny", "Cloudy", "Rainy"]
a = weather.index(S)
print(weather[(a+1)//3])
# Judge status: Wrong Answer
import sys

def tousa(n):
    return int((n*(n-1))/2)

X = int(input())

kyori = 0
count = 0
x = 0

if X < 3:
    print(X)
else:
    while tousa(x) < X:
        x += 1
        count+=1
    
a = X-tousa(x-1)
ans = count -2 + a
print(ans)
# Judge status: Wrong Answer
k, n = map(int, input().split())
a = list(map(int, input().split()))

space = []
for i in range(n - 1):
    s = a[i + 1] - a[i]
    space.append(s)
space.append(k - a[n - 1])

print(k + a[1] - max(space))
# Judge status: Accepted
N, x, *A = map(int, open(0).read().split())
A.sort()
ans = 0
for a in A[:-1]:
    if x - a >= 0:
        x -= a
        ans += 1
    else:
        break
if x == A[-1]:
    ans += 1
print(ans)
# Judge status: Wrong Answer
import math

H, A = map(int, input().split())
ans = H % A
mod = H // A

if A == 1:
    print(math.floor(H/A))
else:
    if mod == 0:
        print(ans)
    else:
        print(ans+1)
# Judge status: Accepted
import sys
n = int(sys.stdin.readline())
A = [int(sys.stdin.readline()) for i in range(n)]
B = sorted(A)
m1 = B[-1]
m2 = B[-2]

for a in A:
    if a == m1:
        print(m2)
    else:
        print(m1)
# Judge status: Accepted
a,b,x = map(int,input().split())
      
print(max(b//x-(a-1)//x,0))
# Judge status: Accepted
n = int(input()); s = input()
a = [0]*26; b = 1
for i in range(n): a[ord(s[i])-97] += 1
for i in range(26): b *= a[i]+1
print((b-1)%(10**9+7))
# Judge status: Wrong Answer
A,B,M = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]
b = [int(s) for s in input().split()]

min_cost = 10 ** 6

for i in range(M):
  x,y,c = [int(s) for s in input().split()]
  if min_cost > a[x-1] + b[y-1] - c:
    min_cost = a[x-1] + b[y-1] - c
    
print(min_cost)
# Judge status: Accepted
N=int(input())
ma=-(-N//1000)
NN=ma*1000-N
print(NN)
# Judge status: Accepted
n = input()

l = list(n[1:])

if all(i == "9" for i in l):
    print(int(n[0]) + 9 * (len(n) - 1))
else:
    print(int(n[0]) - 1 + 9 * (len(n) - 1))
# Judge status: Accepted
N = int(input())
d = sorted(map(int, input().split()))
print(d[N // 2] - d[N // 2 - 1])
# Judge status: Wrong Answer
S=list(input())
countA=0
countB=0
for i in range(3):
    if S[i]=="A":
        countA+=1
    else:
        countB+=1
if countA!=0 and countB!=0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
q = 1000000007

if N == 1:
    if M == 0:
        print(1)
    elif M == 1:
        print(0)
else:
    cost = [0 for _ in range(N + 1)]
    cost[0] = 1

    cnt = 0
    A.append([0])
    for i in range(1, N + 1):
        if i == A[cnt]:
            cost[i] = 0
            cnt += 1
        else:
            cost[i] = (cost[i - 1] + cost[i - 2]) % q

    print(cost[-1])
# Judge status: Accepted
from collections import Counter

S = list(input())
c = Counter(S)

ans = True

if (c["N"]> 0 and c["S"] == 0) or (c["N"]== 0 and c["S"] > 0) or (c["W"] > 0 and c["E"] == 0) or (c["W"] == 0 and c["E"] > 0):
    ans = False

if ans:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
num = int(input())

wa = 0
for i in range(num):
    wa += i+1
    
print(wa)
# Judge status: Accepted
import math
n=int(input())
s=math.factorial(n)
ans=s%(10**9+7)
print(ans)
# Judge status: Wrong Answer
o = input()
e = input()
ans = []

for t, v in zip(o,e):
	ans.append(t)
	ans.append(v)

print("".join(ans))
# Judge status: Accepted
n,m = map(int,input().split())
A = set([int(input()) for i in range(m)])
mod = 10**9+7

dp = [0]*(n+2)
dp[1]=1

for i in range(2,n+2):
    if i-1 not in A:
        dp[i]=dp[i-1]%mod+dp[i-2]%mod
print(dp[n+1]%mod)
# Judge status: Wrong Answer
from collections import Counter


N = int(input())
S = Counter(sorted([input() for _ in range(N)]))
max_app = max(S.values())
for k, v in S.items():
    if v == max_app:
        print(k)
# Judge status: Accepted
N = input()

f = False
for i in N:
    if i == '7':
        f = True
        break
if f:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N<=K:
    print(X*N)
else:
    S = N-K
    print(X*K+Y*S)
# Judge status: Accepted
x = input().split()
a = int(x[0])
b = int(x[1])
c = int(x[2])
if c >= a and c <= b:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
S = list(input())
a = S[::2]
b = S[1::2]

if 'L' in a or 'R' in b:
    print('No')

else:
    print('Yes')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))

cash = 1000
stock = 0

for i in range(n-1):
    if(a[i] > a[i+1]):
        cash += stock * a[i]
        stock = 0
    elif(a[i] < a[i+1]):
        stock = cash // a[i]
        cash %= a[i]
cash += stock * a[n-1]

print(cash)
# Judge status: Accepted
from itertools import combinations
N = int(input())
L = sorted(map(int, input().split()))
ans = 0
for a, b, c in combinations(L, 3):
    if a < b < c and a + b > c:
        ans += 1
print(ans)
# Judge status: Accepted
N, L = map(int, input().split())
ans = 0
min = L

for i in range(1, N+1):
    a = L+i-1
    ans += a
    if abs(a) < abs(min):
        min = a

ans -= min
print(ans)
# Judge status: Accepted
k = int(input())
cont_even = 0
cont_odd = 0
for _ in range(2, k+1, 2):
    cont_even += 1
for _ in range(1, k+1, 2):
    cont_odd += 1
print(cont_even * cont_odd)
# Judge status: Accepted
#A
c = input()
print(chr(ord(c)+1))
# Judge status: Accepted
#template
def inputlist(): return [int(j) for j in input().split()]
#template
N = int(input())
A = inputlist()
maxa = A[0]
ans= 0
for i in range(1,N):
    if A[i] < maxa:
        ans += maxa - A[i]
    else:
        maxa = A[i]
print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
def main():
    N = int( input())
    X = []
    for _ in range(N):
        x, l = map( int, input().split())
        X.append((x-l+1, x+l-1))
    X.sort(reverse=True)
    ans = 0
    now = 10**10
    for i in range( N):
        a, b = X[i]
        if b <= now:
            now = a
            ans += 1
    print(ans)
    
if __name__ == '__main__':
    main()
# Judge status: Accepted
h = int(input())
ans = 0
x = 0
while h!=1:
    ans = ans + 2**x
    x += 1
    h = h//2
print(2**x + ans)
# Judge status: Wrong Answer
# import fractions
# import sys
import math
from sys import stdin

n, k = map(int, stdin.readline().rstrip().split())
ans = 0
for i in range(1, n + 1):
    if k / i <= 1:
        ans += (1 / n)
    else:
        # tmp = 0
        # for j in range(k // i + 1):
        #     if 2 ** j > k // i:
        #         tmp = j
        #         break
        # print(int(math.log2(k / i)) + 1, tmp)
        ans += (1 / n) * (1 / 2) ** (int(math.log2(k // i)) + 1)
print(ans)
# Judge status: Accepted
def main():
    N, x = map(int, input().split())
    a = sorted(map(int, input().split()))
    cnt = 0
    for i in range(N):
      if a[i] <= x:
        cnt += 1
        x -= a[i]
      else:
        break
    if cnt == N and x > 0:
      cnt -= 1
    print(cnt)
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
a=[int(input())for _ in range(5)]
k=int(input())
if a[4]-a[0]<=k:print("Yay!")
else:print(":(")
# Judge status: Wrong Answer
n=int(input())
a=[int(x) for x in input().split()]
for c in range(n-1):
    s=0
    for d in range(c,n-1):
        if a[d]==c+1:
            s+=1
    print(s)
# Judge status: Accepted
N, K = map(int, input().split())
H = [int(x) for x in input().split()]
H = sorted(H)
ans = 0
for i in range(N - K):
    ans += H[i]
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())

list = []
if 100*a%8:
  x=int(a/0.08)+1
else:
  x=int(a/0.08)

if 100*(a+1)%8:
    y=int((a+1)/0.08)
else:
    y=int((a+1)/0.08)-1

    
for i in range(x, y+1):
    if b/0.1 <= i <(b+1)/0.1:
        list.append(i)

        
list = sorted(list)
if list:
    print(list[0])
else:
    print('-1')
# Judge status: Accepted
N = int(input())
listA = [int(input()) for i in range(N)]
count = 0

for x in range(N):
    check = listA[x]
    count += check // 2
    if x != N - 1 and check % 2 != 0:
        if listA[x + 1] > 0:
            count += 1
            listA[x + 1] -= 1
print(count)
# Judge status: Accepted
S = input()
if((S[-1] == '2') or (S[-1] == '4') or (S[-1] == '5') or (S[-1] == '7') or (S[-1] == '9')) :
  print("hon")
elif((S[-1] == '0') or (S[-1] == '1') or (S[-1] == '6') or (S[-1] == '8')) :
  print("pon")
else :
  print("bon")
# Judge status: Accepted
A,B = map(int,input().split())

cnt = 0
for i in range(A,B+1):
  i = str(i)
  if i == i[::-1]:
    cnt += 1
    
print(cnt)
# Judge status: Accepted
x,y,z = list(map(int,input().split()))

chg_box = x
x = y
y = chg_box

chg_box = x
x = z
z = chg_box

print(x,y,z)
# Judge status: Wrong Answer
N,M = map(int,input().split())

Check_AC = [0]*N
WA_Counter = 0

for i in range(M):
    pi,Si = input().split()
    pi = int(pi)
    # まだ正解していない問題
    if Check_AC[pi-1] == 0:
        if Si == "AC":
            Check_AC[pi-1] = 1
        else:
            WA_Counter += 1
    
print(str(sum(Check_AC)) + " " + str(WA_Counter))
# Judge status: Accepted
N , M = map(int , input().split())
A = [str(input()) for i in range(N)]
B = [str(input()) for i in range(M)]

def bina(A , B):
    for i in range((N-M)+1):
        for w in range(N):
            c = []
            for q in range(M):
                c += [A[i+q][w:w+M]]
            if c == B:
                return "Yes"
    return "No"

if __name__ == '__main__':
    ans = bina(A , B)
    print(ans)
# Judge status: Wrong Answer
x = int(input()[-3:])

if 100 <= x <= 105 or 201 <= x <= 209 or 303 <= x <= 312 or 406 <= x <= 414 or \
    510 <= x <= 515 or x == 615:
    print(1)
else:
    print(0)
# Judge status: Accepted
print(["No","Yes"][input() in ["hi" * x for x in range(1,6)]])
# Judge status: Accepted
X, Y = map(int, input().split())

t = (Y - 2 * X) // 2
c = (4 * X - Y) // 2

if c < 0 or t < 0:
    print('No')
else:
    if c+t == X:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
a, b, c = map(int, input().split())

times = 0
if a == b and b == c and a % 2 == 0:
    print(-1)
else:
    while 1:
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break
        a, b, c = int((b + c)/2), int((c + a)/2), int((a + b)/2)
        times += 1

    print(times)
# Judge status: Accepted
s = list(input())

size = len(s)


for i in range(size):
    s[i] = "x"
    print(s[i], end="")
# Judge status: Wrong Answer
coin = int(input())
siawase = 0
if coin >= 500:
    siawase = siawase + int(coin / 500) * 1000
    amari = coin % 500
    print(siawase)
    print(amari)
    siawase = siawase + int(amari / 5) *5
elif coin >= 5:
    siawase = siawase + int(coin / 5) * 5
    
print(int(siawase))
# Judge status: Wrong Answer
def resolve():
    k = int(input())
    if k % 2 == 0:
        print(-1)
        return
    for i in range(1, 10 ** 6):
        if (7 * pow(10, i, k)) % k == 7 % k:
            print(i)
            return
    print(-1)


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
X, Y = map(int,input().split())
crain = (4 * X - Y) / 2
turtle = (Y- 2*X) /2
if crain.is_integer() and crain >= 0 and turtle.is_integer() and turtle >= 0 :
    crain = int(crain)
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a,b,c=map(int,input().split())
k=int(input())
print(max([a,b,c])*2**k+a+b+c-max([a,b,c]))
# Judge status: Accepted
A, B, T =map(int,input().split())
print( int((T+0.5)//A * B))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))

a = sorted(A)
print(a)
result = list()

for i in range(N):
   result.append(A.index(a[i]) + 1)
  
print(result)
# Judge status: Accepted
a = input()

if (a[-1] != "s"):
    a += "s"

else :
    a += "es"

print(a)
# Judge status: Accepted
n=int(input())
ans=0
for a in range(1,n):
  x=(n-1)//a
  ans+=x
print(ans)
# Judge status: Accepted
s=int(input())

if s==10**18:
  print(0,0,0,1000000000,1000000000,0)
  exit()

y=s//1000000000+1
x=1000000000*y-s


print(0,0,1000000000,1,x,y)
# Judge status: Accepted
S = input()

if S == 'ARC' :
    print('ABC')
else :
    print('ARC')
# Judge status: Accepted
N = int(input())
S = input()

from collections import Counter
c = Counter()

for si in S:
    c[si] += 1

# print(c.values())

ans = 1
for n in c.values():
    ans *= n + 1

ans -= 1
ans = ans % (10 ** 9 + 7)
print(ans)
# Judge status: Wrong Answer
n = int(input())
lst = list(map(int,input().split()))

res = 0
if n==1 or n==2:
    res = 1
else:
    for i in range(1,n-1):
        if lst[i-1] > lst[i] and lst[i] < lst[i+1]:
            res += 1
            lst[i] = lst[i+1]
        elif lst[i-1] < lst[i] and lst[i] > lst[i+1]:
            res += 1
            lst[i] = lst[i+1]
print(res + 1)
# Judge status: Accepted
s = int(input())
a = [s]
for i in range(1000000):
  if a[i]%2==0:
    b=a[i]/2
  else:
    b=a[i]*3+1
  if b in a:
    print(i+2)
    break
  else:
    a.append(b)
# Judge status: Wrong Answer
K, N = map(int, input().split())
A = list(map(int, input().split()))
if A[0] == 0:
    A.remove(0)
if len(A) == 1:
    ans = A[0]
else:
    ans = A[-1] - A[0]
print(ans)
# Judge status: Accepted
N = int(input())
abc = [list(map(int,input().split())) for _ in range(N)]
dp = [[0]*3 for _ in range(N)]
dp[0][0],dp[0][1],dp[0][2] = abc[0][0],abc[0][1],abc[0][2]

for i in range(1,N):
  for j in range(3):
    for k in range(3):
      if j != k:
        dp[i][k] = max(dp[i][k], dp[i-1][j] + abc[i][k])

ans = max(dp[N-1])
print(ans)
# Judge status: Accepted
# dfs
import sys
sys.setrecursionlimit(10**6)

C = ['dream', 'dreamer', 'erase', 'eraser']
S = input()
L = len(S)


def dfs(x, l):
    if l == L:
        return True
    elif l > L:
        return False

    match = S[l:l+7]
    for c in C:
        if match.find(c) == 0:
            if dfs(c, l+len(c)):
                return True
    return False


print('YES' if dfs('', 0) else 'NO')
# Judge status: Wrong Answer
from collections import defaultdict
d=defaultdict(lambda: 50)
n=int(input())
for _ in range(n):
    s=input()
    for char in [chr(ord('a') + i) for i in range(26)]:
        d[char] = min(d[char],s.count(char))

ans=""
for char,i in zip(d.keys(),d.values()):
    ans += char*i

print(ans)
# Judge status: Wrong Answer
cards = list(map(int,input().split()))
K = int(input())
for i in range(K):
    if cards[1]>cards[2]:
        cards[2]*=2
    elif cards[0]>cards[1]:
        cards[1]=cards[1]*2
    else :
        cards[0]*=2

if cards[0]<cards[1]<cards[2]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
def main():
    n = int(input())
    a = tuple(map(int, input().split()))
    ans = 0
    lim = max(a)
    amount = [0]*lim
    for i in range(lim):
        amount[0] = a.count(i+1)
        ans += amount[i]*(amount[i]-1)//2
    #print(ans)
    for j in range(n):
        ansout = ans
        #print(amount[a[j]-1])
        ansout -= amount[a[j]-1] -1
        print(ansout)

if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
input = sys.stdin.readline
def main():
    X, Y, A, B, C = map(int, input().split())
    p = list(map(int, input().split()))
    p.sort(reverse=True)
    q = list(map(int, input().split()))
    q.sort(reverse=True)
    r = list(map(int, input().split()))
    r.sort(reverse=True)
    target = p[:X] + q[:Y] + r
    target.sort(reverse=True)
    ans = sum(target[:X+Y])
    print(ans)
if __name__ == "__main__":
    main()
# Judge status: Accepted
N, M = map(int, input().split())
if N == 1 and M == 1:print(1)
elif N == 1:print(M-2)
elif M == 1:print(N-2)
else:
	print((N*M)-(N*2)-(M*2)+4)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in range(0,len(a),2):
    if a[i]%2==1:
        cnt += 1
print(cnt)
# Judge status: Accepted
A,B,C = map(int,input().split())

if A%2==B%2==C%2==0 and A==B==C:
  print(-1)
  exit()

cnt=0
while(A%2==B%2==C%2==0):
  _A=A;_B=B;_C=C
  A=_B//2+_C//2
  B=_A//2+_C//2
  C=_B//2+_A//2
  cnt+=1
  #print(cnt,A,B,C)
print(cnt)
# Judge status: Accepted
N = int(input())

while True:
    if len(set(str(N))) == 1:
        print(N)
        exit()
    N += 1
# Judge status: Accepted
x = int(input())

tmp = 2
ans = 1

while tmp*tmp <= x:
    cur = tmp*tmp
    while cur*tmp <= x:
        cur *= tmp
    ans = max(ans, cur)
    tmp += 1

print(ans)
# Judge status: Accepted
# import bisect
n,m=map(int,input().split())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

div=make_divisors(m)
ans=1
for i in range(len(div)):
    if(div[i]>m/n):
        break
    ans=max(div[i],ans)
print(ans)
# Judge status: Wrong Answer
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
ans = 1000
tmper = []
for i in range(N):
	tmper.append(abs(T - H[i]*0.006))
	ans = min(ans,abs(T - H[i]*0.006))
print(tmper.index(ans))
# Judge status: Accepted
n=int(input())
s=list(input())
w=[0]*n
for i in range(n):
    if s[i]=="E":
        w[i]=1
from itertools import accumulate    
d=list(accumulate([0]+w))
ans=n
cnt=0
for i in range(n):
    cnt=i-d[i]+d[-1]-d[i+1]
    ans=min(ans,cnt)
print(ans)
# Judge status: Accepted
def main():
    N, Y = map(int,input().split())
    x, y, z = [0, 0, 0]
    
    for i in range(N + 1):
        for j in range(N + 1 - i):
            if i * 10000 + j * 5000 + (N-i-j) * 1000 == Y and N-i-j >= 0:
                print(i, j , N-i-j)
                return
    
    print(-1, -1, -1)

if __name__ == "__main__":
    main()