Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import statistics
N = int(input())
Xlist = list(map(int, input().split()))
for i in range(N):
    a = Xlist[0:i] + Xlist[i + 1:]
    print(statistics.median(a))


### FIXED CODE ###

N = int(input())
Xlist = list(map(int, input().split()))
X_sort = sorted(Xlist)
left_med = X_sort[N//2-1]
right_med = X_sort[N//2]
for i in range(N):
    if Xlist[i] <= left_med:
        print(right_med)
    else:
        print(left_med)
### BUGGY CODE ###

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

ret = 1
for i in range(n):
	ret = ret*a[i]

if(ret > 10**18):
	print(-1)
else:
	print(ret)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
MAX = 10**18

ret = 1
for i in range(n):
	if(ret <= MAX):
		ret = ret*a[i]
	if(a[i] == 0):
		ret = 0
		break


if(ret > MAX):
	print(-1)
else:
	print(ret)
### BUGGY CODE ###

import sys
import math
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix
import itertools
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

for i in range(N):
    print(A.count(str(i + 1)))


### FIXED CODE ###

import sys
import math
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix
import itertools
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

c = Counter(A)
for i in range(N):
    print(c[str(i + 1)])
### BUGGY CODE ###

from collections import Counter

n, m = map(int, input().split())
ab = sorted([list(map(int, input().split())) for i in range(n)])
c = [[]] * m
a, b = ab[0]
last = a
ad = [b]
for i in range(1, n):
    a, b = ab[i]
    if a == last:
        ad.append(b)
    else:
        if last <= m:
            c[last - 1] = ad
        ad = [b]
    last = a
if a <= m:
    c[a - 1] = ad
choice = {}
ans = 0
for i in range(m):
    choice = dict(Counter(choice) + Counter(c[i]))
    if choice:
        use = max(choice)
        ans += use
        choice[use] -= 1
print(ans)

### FIXED CODE ###

import heapq

n, m = map(int, input().split())
ab = sorted([list(map(int, input().split())) for i in range(n)])
c = [[]] * m
a, b = ab[0]
last = a
ad = [b]
for i in range(1, n):
    a, b = ab[i]
    if a == last:
        ad.append(b)
    else:
        if last <= m:
            c[last - 1] = ad
        ad = [b]
    last = a
if a <= m:
    c[a - 1] = ad
a = [3, 0, 2, 6]
choice = []
heapq.heapify(choice)
ans = 0
for i in range(m):
    for j in c[i]:
        heapq.heappush(choice, -j)
    if choice:
        ans -= heapq.heappop(choice)
print(ans)
### BUGGY CODE ###

from collections import deque

def cal():
    h, w = map(int, input().split())
    a = [list(input()) for _ in range(h)]
    q = deque()
    INF = float('inf')
    counts = [[False]*w for _ in range(h)]
    
    for i in range(w):
        for j in range(h):
            if a[j][i] == '#':
                q.append([i, j, 0])
                counts[j][i] = True

    while q:
        x, y, z = q.popleft()
        for i, j in ((1, 0), (-1, 0), (0, 1), (0, -1)):
            x0 = x+j
            y0 = y+i
            if 0 <= x0 < w and 0 <= y0 < h:
                if counts[y0][x0] is False:
                    counts[y0][x0] = True
                    q.append([x0, y0, z+1])
    print(z)

cal()


### FIXED CODE ###

from collections import deque

def cal():
    h, w = map(int, input().split())
    q = deque()
    counts = [[True for _ in range(w+2)]]+[[True]+[False]*w+[True] for _ in range(h)]+[[True for _ in range(w+2)]]
    for i in range(h):
        a = input()
        for j in range(w):
            if a[j] == '#':
                q.append([i+1, j+1, 0])
                counts[i+1][j+1] = True

    while q:
        x, y, z = q.popleft()    
        if not counts[x+1][y]:
            counts[x+1][y] = True
            q.append([x+1, y, z+1])
        if not counts[x-1][y]:
            counts[x-1][y] = True
            q.append([x-1, y, z+1])
        if not counts[x][y+1]:
            counts[x][y+1] = True
            q.append([x, y+1, z+1])
        if not counts[x][y-1]:
            counts[x][y-1] = True
            q.append([x, y-1, z+1])
    print(z)
    

cal()
### BUGGY CODE ###

S = input()
count = 0
for i in range(len(S)):
    if S[i] == 'W':
        count += S[0:i].count('B')
print(count)



### FIXED CODE ###

S = input()
count = 0
ans = 0
for i in range(len(S)):
    if S[i] == 'W':
        ans += count
    else:
        count += 1
print(ans)
### BUGGY CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [-int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    N,K = LI()
    a = LI()

    for _ in range(K):
        x = [0] * N
        for i in range(N):
            s = i - a[i]
            if s < 0: s = 0
            x[s] += 1
            t = i + a[i] + 1
            if t < N:
                x[t] -= 1
        a = []
        cnt = 0
        for i in range(N):
            cnt += x[i]
            a.append(cnt)

    print(*a,sep=' ')


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [-int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    N,K = LI()
    a = LI()

    for _ in range(K):
        x = [0] * N
        for i in range(N):
            s = i - a[i]
            if s < 0: s = 0
            x[s] += 1
            t = i + a[i] + 1
            if t < N:
                x[t] -= 1
        a = []
        cnt = 0
        finish = True
        for i in range(N):
            cnt += x[i]
            if cnt < N: finish = False
            a.append(cnt)
        if finish: break
    print(*a,sep=' ')


if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys
def sieve(m):
    N=range(1,m+2,2)
    r=int(m**.5)
    h=len(N)
    N[0]=0
    for i in range(h):
        x=N[i]
        if x>r: break
        if x and i+x<h: N[i+x:h:x]=[0] * ((h-1-i-x)/x+1)
    return N
def f0056(n):
    x=0
    b=n/2
    if n==2 or n==3: return 1
    if n%2==1:
        if n-2 in PRIMES: x=1
    else:
        for e in PRIMES:
            if e>b:break
            if n-e in PRIMES: x+=1
    return x
        
SIEVES=sieve(50000)
PRIMES=filter(None,[2]+SIEVES)
for n in sys.stdin:
    n=int(n)
    if n==0: break
    print f0056(n)

### FIXED CODE ###

import sys
def sieve(m):
    N=range(1,m+2,2)
    r=int(m**.5)
    h=len(N)
    N[0]=0
    for i in range(h):
        x=N[i]
        if x>r: break
        if x and i+x<h: N[i+x:h:x]=[0]*((h-1-i-x)/x+1)
    return N
def f0056(n):
    x=0
    if n<4:x=0
    elif n==4:x=1
    elif n%2==1:
        if S[n/2-1]: x=1
    else:
        a=n/2
        for e in PRIMES:
            if e>a: break
            if S[(n-e)/2]: x+=1
    return x

S=sieve(50000)
PRIMES=filter(None,S)
for n in sys.stdin:
    n=int(n)
    if n==0: break
    print f0056(n)
### BUGGY CODE ###

import itertools
from collections import deque
from sys import stdin
input = stdin.readline


def main():
  H, W = list(map(int, input().split()))

  M = [input()[:-1] for _ in range(H)]

  def bfs(start, goal):
    dist = [[float('inf')]*W for _ in range(H)]
    dist[start[0]][start[1]] = 0
    is_visited = set()
    q = deque([start])
    while len(q):
      now_h, now_w = q.popleft()
      if M[now_h][now_w] == '#':
        return
      is_visited.add((now_h, now_w))
      for next_h, next_w in ((now_h+1, now_w),
                             (now_h-1, now_w),
                             (now_h, now_w-1),
                             (now_h, now_w+1)):

        if ((next_h, next_w) in is_visited) or not(0 <= next_h < H) or not(0 <= next_w < W):
          continue

        if M[next_h][next_w] == '#':
          continue

        dist[next_h][next_w] = dist[now_h][now_w] + 1
        if goal == (next_h, next_w):
          return dist[next_h][next_w]
        q.append((next_h, next_w))

  all_ = []
  for h in range(H):
    for w in range(W):
      all_.append((h, w))

  max_ = 0
  for start, goal in itertools.combinations(all_, 2):
    if M[start[0]][start[1]] == '.' and M[goal[0]][goal[1]] == '.':
      max_ = max(max_, bfs(start, goal))

  print(max_)


if(__name__ == '__main__'):
  main()


### FIXED CODE ###

import itertools
from collections import deque
from sys import stdin
input = stdin.readline


def main():
  H, W = list(map(int, input().split()))

  M = [input()[:-1] for _ in range(H)]

  def bfs(start):
    dist = [[float('inf')]*W for _ in range(H)]
    dist[start[0]][start[1]] = 0

    q = deque([start])
    max_ = 0

    while len(q):
      now_h, now_w = q.popleft()
      for next_h, next_w in ((now_h+1, now_w),
                             (now_h-1, now_w),
                             (now_h, now_w-1),
                             (now_h, now_w+1)):

        if not(0 <= next_h < H) or not(0 <= next_w < W) or \
           (dist[next_h][next_w] != float('inf')) or \
           M[next_h][next_w] == '#':
          continue

        temp = dist[now_h][now_w] + 1
        dist[next_h][next_w] = temp
        if max_ < temp:
          max_ = temp
        q.append((next_h, next_w))
    return max_

  max_ = 0
  for h in range(H):
    for w in range(W):
      if M[h][w] == '.':
        max_ = max(bfs((h, w)), max_)

  print(max_)


if(__name__ == '__main__'):
  main()
### BUGGY CODE ###

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


sa=float('inf')
for i in range(n):
  sa=min(sa,abs(sum(A[:i])-sum(A[i:])))
print(sa)


### FIXED CODE ###

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

l=0
r=sum(A)
ans=float('inf')
for i in range(n):
  l+=A[i]
  r-=A[i]
  ans=min(ans,abs(l-r))
print(ans)
### BUGGY CODE ###

import numpy as np


N = int(input())
A = np.array([int(i) for i in input().split(' ')], dtype=np.int32)
cnt = 0
first = 0
xsum_old = 0
r_old = 0
for l in range(0, N):
    xsum = xsum_old
    first = A[l]
    cnt += r_old - l
    for r in range(r_old, N):
        if np.bitwise_and(xsum, A[r]) > 0:
            xsum_old = xsum - first
            r_old = r
            break
        xsum += A[r]
        cnt += 1
print(cnt)

### FIXED CODE ###

N = int(input())
A_raw = input()
A = [int(i) for i in A_raw.split(' ')]
cnt = 0
first = 0
xsum_old = 0
r_old = 0
for l in range(0, N):
    xsum = xsum_old
    first = A[l]
    cnt += r_old - l
    isBreak = False
    for r in range(r_old, N):
        if xsum & A[r] > 0:
            xsum_old = xsum - first
            r_old = r
            isBreak = True
            break
        xsum += A[r]
        cnt += 1
    if isBreak == False:
        r_old = r
print(cnt)
### BUGGY CODE ###

n = int(input())
s = input()
r = []
g = []
b = []

for i in range(n):
  if s[i] == 'R':
    r.append(i)
  elif s[i] == 'G':
    g.append(i)
  else:
    b.append(i)
res = 0
for i in r:
  for j in b:
    flg = 0
    if (i + j) / 2 in g:
      flg += 1
    if 2 * i - j in g:
      flg += 1
    if 2 * j - i in g:
      flg += 1
    res += len(g) - flg
print(res)


### FIXED CODE ###

n=int(input())
s=input()
R=[]
G={}
B=[]
for i in range(n):
  if s[i]=='R':
    R.append(i+1)
  elif s[i]=='G':
    G[i+1]=G.get(i+1,0)+1
  else:
    B.append(i+1)
res=len(R)*len(G)*len(B)
for i in R:
  for j in B:
    if ((i+j)%2==0 and G.get((i+j)//2,0)==1):
      res-=1
    if G.get(2*max(i,j)-min(i,j),0)==1:
      res-=1
    if G.get(2*min(i,j)-max(i,j),0)==1:
      res-=1
print(res)
### BUGGY CODE ###

N = int(input())
S = input()
count = 0
if N <= 3:
    print('0')
else:
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if S[i] != S[j] and S[j] != S[k] and S[k] != S[i] and j-i != k-j:
                    count += 1
    print(count)

### FIXED CODE ###

N = int(input())
S = input()
if N <= 3:
    print('0')
else:
    minuscount = 0
    Rcount = 0
    Gcount = 0
    Bcount = 0 
    for i in range(N):
        if S[i] == 'R':
            Rcount += 1
        elif S[i] == 'G':
            Gcount += 1
        else:
            Bcount += 1
        for j in range(1,N):
            if i+2*j>=N:
                break
            if S[i] != S[i+j] and S[i+j] != S[i+2*j] and S[i+2*j] != S[i]:
                minuscount += 1

    print(Rcount*Gcount*Bcount-minuscount)
### BUGGY CODE ###

n = input()
s = list(input())
n = int(n)
ans = 0

for i in range(n):
    for j in range(i,n):
        for k in range(j, n):
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k] and j - i != k -j:
                ans += 1
print(ans)

### FIXED CODE ###

n = input()
s = list(input())
n = int(n)

r = s.count("R")
g = s.count("G")
b = s.count("B")
ans = r*g*b

for i in range(1,n):
    for j in range(min(i+1,n-i)):
        k = j*2 -i
        if j - i == k -j:
            if k <= n and s[i] != s[i+j] and s[i] != s[i-j] and s[i+j] != s[i-j]:
                ans -= 1
print(ans)
### BUGGY CODE ###

A,B,N = map(int,input().split())
ans = 0
if N >= B-1:
    for i in range(B-1,N+1,B):
        a =A*i//B
        b = A*(i//B)
        ans = max(ans,a-b)
else:
    ans = A*N//B - A*(N//B)
print(ans)


### FIXED CODE ###

A,B,N = map(int,input().split())
if N >= B-1:
    i = B-1
    ans = A*i//B - A*(i//B)
else:
    ans = A*N//B - A*(N//B)
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

"""
・とりあえず部分点解法：各クエリに対してO(N)
・いくつかを残していくつかを自由に埋める
・残すもの：被覆区間がoverlapしないように残す
・つまり、区間で覆えている点が処理できて、区間で覆えていない点が他所から持ってこないといけない。
"""

N,M = map(int,input().split())
A = [int(x) for x in input().split()]
XY = [tuple(int(x) for x in input().split()) for _ in range(M)]

def naive_solution(A):
    from collections import Counter
    covered = [False] * (N+N+10)
    for key,cnt in Counter(A).items():
        for i in range(cnt):
            covered[max(0,key-i)] = True
    return sum(not bl for bl in covered[1:N+1])

for x,y in XY:
    A[x-1] = y
    print(naive_solution(A))



### FIXED CODE ###

import sys
input = sys.stdin.readline

"""
・とりあえず部分点解法：各クエリに対してO(N)
・いくつかを残していくつかを自由に埋める
・残すもの：被覆区間がoverlapしないように残す
・つまり、区間で覆えている点が処理できて、区間で覆えていない点が他所から持ってこないといけない。
"""

N,M = map(int,input().split())
A = [int(x) for x in input().split()]
XY = [tuple(int(x) for x in input().split()) for _ in range(M)]

def subscore_solution():
    from collections import Counter
    for x,y in XY:
        A[x-1] = y
        covered = [False] * (N+N+10)
        for key,cnt in Counter(A).items():
            for i in range(cnt):
                covered[max(0,key-i)] = True
        print(sum(not bl for bl in covered[1:N+1]))

counter = [0] * (N+1)
covered = [0] * (N+N+10)
for a in A:
    counter[a] += 1
    covered[a-counter[a]+1] += 1
magic = sum(x==0 for x in covered[1:N+1])

for i,y in XY:
    x = A[i-1]
    A[i-1] = y
    rem = x - counter[x] + 1
    counter[x] -= 1
    counter[y] += 1
    add = y - counter[y] + 1
    covered[rem] -= 1
    if 1<=rem<=N and covered[rem] == 0:
        magic += 1
    if 1<=add<=N and covered[add] == 0:
        magic -= 1
    covered[add] += 1
    print(magic)
### BUGGY CODE ###

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

for i in range(n-1):
    print(a.count(i+1))
print(0)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
anss = [0] * n
for _ in a:
    anss[_-1] += 1
for ans in anss:
    print(ans)
### BUGGY CODE ###

from bisect import bisect_right

N,K=list(map(int, input().split()))
A=list(map(int, input().split()))
A.sort()
S=set(A)
S=list(S)
B=[]

def bisectsearch_right(L, a):
    i = bisect_right(L, a)
    return(i)

for i in S:
  a=A[0]
  j = bisect_right(A,a)
  B+=[j]
  del A[:j]
B.sort()
# print(B)
C=B[:len(S)-K]
print(sum(C))


### FIXED CODE ###

from collections import Counter

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

dic = dict(Counter(A))
ls = list(dic.items())
ls.sort(key=lambda x: x[1])

i=0
ans=0
res=len(ls)
while 1:
  if res <= K or i >= N:
    break
  ans += ls[i][1]
  i+=1
  res-=1
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

def main():
    s = input().strip()
    n = len(s)
    stset = set()
    k = int(input().strip())
    for i in range(n):
        for j in range(i+1, n+1):
            stset.add(s[i:j])
    print(sorted(stset)[k-1])

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30
import heapq

def main():
    s = input().strip()
    n = len(s)
    stq = set()
    k = int(input().strip())
    for i in range(n):
        for j in range(i+1, min(i+1+k+1, n+1)):
            stq.add(s[i:j])
    stq = list(stq)
    heapq.heapify(stq)
    for i in range(k):
        ans = heapq.heappop(stq)
        if i == k-1:
            print(ans)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

A,B = map(int,input().split())
ans = A
for _ in range(A+1,B+1):
    ans = ans^_
print(ans)

### FIXED CODE ###

def calcF(n):
    if n%2 == 0:
        if n%4 == 0:
            return n
        else:
            return n^1
    else:
        if (n+1)%4 == 0:
            return 0
        else:
            return 1
A,B = map(int,input().split())
ans_A = calcF(A-1)
#print(ans_A)
ans_B = calcF(B)
#print(ans_B)
ans = ans_A^ans_B
print(ans)
### BUGGY CODE ###

import itertools
import sys

readline = sys.stdin.buffer.readline


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)


def main():
    N, M, K = map(int, readline().split())
    AB = [list(map(int, readline().split())) for _ in range(M)]
    CD = [list(map(int, readline().split())) for _ in range(K)]

    E = UnionFind(N)

    for a, b in AB:
        a -= 1
        b -= 1
        E.unite(a, b)

    for i in range(N):
        E.find(i)

    ans = [0 for _ in range(N)]
    for i, j in itertools.combinations(list(range(N)), 2):
        if i != j:
            if E.same(i, j):
                ans[i] += 1
                ans[j] += 1

    for i, j in CD:
        i -= 1
        j -= 1
        if E.same(i, j):
            ans[i] -= 1
            ans[j] -= 1
    for i, j in AB:
        i -= 1
        j -= 1
        ans[i] -= 1
        ans[j] -= 1

    print(*ans)


main()


### FIXED CODE ###

import collections
import itertools
import sys

readline = sys.stdin.buffer.readline


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)


def main():
    N, M, K = map(int, readline().split())
    AB = [list(map(int, readline().split())) for _ in range(M)]
    CD = [list(map(int, readline().split())) for _ in range(K)]

    E = UnionFind(N)

    ans = [0 for _ in range(N)]
    for a, b in AB:
        a -= 1
        b -= 1
        E.unite(a, b)
        ans[a] -= 1
        ans[b] -= 1

    for i in range(N):
        E.find(i)

    ll = collections.defaultdict(int)
    for i in E.par:
        ll[i] += 1

    for i in range(N):
        ans[i] += ll[E.par[i]] - 1

    for i, j in CD:
        i -= 1
        j -= 1
        if E.same(i, j):
            ans[i] -= 1
            ans[j] -= 1

    print(*ans)


main()