In BerSoft $n$ programmers work, the programmer $i$ is characterized by a skill $r_i$.

A programmer $a$ can be a mentor of a programmer $b$ if and only if the skill of the programmer $a$ is strictly greater than the skill of the programmer $b$ $(r_a > r_b)$ and programmers $a$ and $b$ are not in a quarrel.

You are given the skills of each programmers and a list of $k$ pairs of the programmers, which are in a quarrel (pairs are unordered). For each programmer $i$, find the number of programmers, for which the programmer $i$ can be a mentor.


-----Input-----

The first line contains two integers $n$ and $k$ $(2 \le n \le 2 \cdot 10^5$, $0 \le k \le \min(2 \cdot 10^5, \frac{n \cdot (n - 1)}{2}))$ — total number of programmers and number of pairs of programmers which are in a quarrel.

The second line contains a sequence of integers $r_1, r_2, \dots, r_n$ $(1 \le r_i \le 10^{9})$, where $r_i$ equals to the skill of the $i$-th programmer.

Each of the following $k$ lines contains two distinct integers $x$, $y$ $(1 \le x, y \le n$, $x \ne y)$ — pair of programmers in a quarrel. The pairs are unordered, it means that if $x$ is in a quarrel with $y$ then $y$ is in a quarrel with $x$. Guaranteed, that for each pair $(x, y)$ there are no other pairs $(x, y)$ and $(y, x)$ in the input.


-----Output-----

Print $n$ integers, the $i$-th number should be equal to the number of programmers, for which the $i$-th programmer can be a mentor. Programmers are numbered in the same order that their skills are given in the input.


-----Examples-----
Input
4 2
10 4 10 15
1 2
4 3

Output
0 0 1 2 

Input
10 4
5 4 1 5 4 3 7 1 2 5
4 6
2 1
10 8
3 5

Output
5 4 0 5 3 3 9 0 2 5 



-----Note-----

In the first example, the first programmer can not be mentor of any other (because only the second programmer has a skill, lower than first programmer skill, but they are in a quarrel). The second programmer can not be mentor of any other programmer, because his skill is minimal among others. The third programmer can be a mentor of the second programmer. The fourth programmer can be a mentor of the first and of the second programmers. He can not be a mentor of the third programmer, because they are in a quarrel.

Difficulty: MEDIUM

Solutions:
from bisect import bisect_left
(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
sa = sorted(a)
ans = [0] * n
for i in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if a[x] > a[y]:
		ans[x] -= 1
	if a[y] > a[x]:
		ans[y] -= 1
for i in range(n):
	t = bisect_left(sa, a[i])
	ans[i] += t
	print(ans[i], end=' ')


(n, k) = map(int, input().split())
skills = [int(i) for i in input().split()]
dic = {}
ret = []
s = sorted(skills)
dic[s[0]] = 0
for i in range(1, n):
	if s[i] != s[i - 1]:
		dic[s[i]] = i
s = [0] * n
for i in range(k):
	(a, b) = map(int, input().split())
	if skills[a - 1] > skills[b - 1]:
		s[a - 1] -= 1
	elif skills[a - 1] < skills[b - 1]:
		s[b - 1] -= 1
for i in range(n):
	print(dic[skills[i]] + s[i] if dic[skills[i]] + s[i] > 0 else 0, end=' ')


from bisect import bisect_left

def main():
	(n, k) = map(int, input().split())
	skill = [int(x) for x in input().split()]
	sorted_skill = sorted(skill)
	inferior = [bisect_left(sorted_skill, sk) for sk in skill]
	for _ in range(k):
		(x, y) = map(int, input().split())
		x -= 1
		y -= 1
		if skill[x] < skill[y]:
			inferior[y] -= 1
		if skill[y] < skill[x]:
			inferior[x] -= 1
	print(*inferior)
main()


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

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

def si():
	return input()

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

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

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

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	if y == 0:
		return 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	(n, k) = read()
	skill = get_list()
	ss = sorted(skill)
	result = [bis.bisect_left(ss, x) for x in skill]
	for i in range(k):
		(x, y) = read()
		x -= 1
		y -= 1
		if skill[x] < skill[y]:
			result[y] -= 1
		elif skill[x] > skill[y]:
			result[x] -= 1
	print(*result)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = 1
for i in range(t):
	solve()


from collections import Counter

def search(key, arr):
	low = 0
	high = len(arr) - 1
	while low <= high:
		mid = (low + high) // 2
		if arr[mid] == key:
			break
		elif arr[mid] < key:
			low = mid + 1
		else:
			high = mid - 1
	return mid
(n, q) = list(map(int, input().split()))
l = list(map(int, input().split()))
d = dict()
sel = dict(Counter(l))
no = sorted(set(l))
tab = [sel[no[0]]]
for i in range(1, len(no)):
	tab.append(tab[i - 1] + sel[no[i]])
for i in range(q):
	(li, r) = list(map(int, input().split()))
	li -= 1
	r -= 1
	if li in d:
		d[li].append(r)
	else:
		d[li] = [r]
	if r in d:
		d[r].append(li)
	else:
		d[r] = [li]
fin = []
for i in range(n):
	x = search(l[i], no)
	if x == 0:
		sum1 = 0
	else:
		sum1 = tab[x - 1]
		if i in d:
			for j in range(len(d[i])):
				if l[d[i][j]] < l[i]:
					sum1 -= 1
	fin.append(sum1)
print(*fin)


import bisect
(n, k) = map(int, input().split())
ar = list(map(int, input().split()))
v = sorted(ar)
ans = [0] * n
for i in range(n):
	ans[i] = bisect.bisect_left(v, ar[i])
for i in range(k):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	if ar[a] < ar[b]:
		ans[b] -= 1
	elif ar[a] > ar[b]:
		ans[a] -= 1
print(*ans)


from collections import defaultdict

def solve(skills, quarrels):
	ans = [0] * len(skills)
	skills_mapping = defaultdict(list)
	for (i, skill) in enumerate(skills):
		skills_mapping[skill].append(i)
	quarrels_mapping = defaultdict(int)
	for (i, j) in quarrels:
		if skills[i - 1] == skills[j - 1]:
			continue
		elif skills[i - 1] < skills[j - 1]:
			(i, j) = (j, i)
		quarrels_mapping[i - 1] += 1
	tmp = len(skills)
	for skill in sorted(set(skills), reverse=True):
		group_size = len(skills_mapping[skill])
		for i in skills_mapping[skill]:
			ans[i] = max(0, tmp - quarrels_mapping[i] - group_size)
		tmp -= group_size
	return ans

def main():
	(_, k) = map(int, input().strip().split())
	skills = [int(x) for x in input().strip().split()]
	quarrels = [[int(x) for x in input().strip().split()] for _ in range(k)]
	result = solve(skills, quarrels)
	print(' '.join(map(str, result)))
main()


from collections import Counter, defaultdict
from bisect import bisect_left as bl

def f(q, l, bad):
	skill = l.copy()
	ans = [0] * len(l)
	l = list(zip(l, range(len(l))))
	l = sorted(l, key=lambda s: s[0])
	for i in range(len(l)):
		ll = bl(l, (skill[i], -float('inf')))
		ans[i] += ll
		ans[i] -= badcnt[i]
	return ans
(n, k) = map(int, input().strip().split())
l = list(map(int, input().strip().split()))
q = set()
badcnt = defaultdict(int)
for i in range(k):
	(a, b) = map(int, input().strip().split())
	if l[a - 1] > l[b - 1]:
		badcnt[a - 1] += 1
	if l[b - 1] > l[a - 1]:
		badcnt[b - 1] += 1
	q.add((a, b))
print(*f(q, l, badcnt))


from bisect import bisect_left
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
xy = [tuple(map(int, input().split())) for i in range(k)]
s = sorted(r)
s.sort()
ans = [0] * n
for (i, x) in enumerate(r):
	id = bisect_left(s, x)
	ans[i] = id
for (x, y) in xy:
	x -= 1
	y -= 1
	if r[x] > r[y]:
		ans[x] -= 1
	elif r[x] < r[y]:
		ans[y] -= 1
print(*ans)


from bisect import *
(n, m) = map(int, input().split())
l = list(map(int, input().split()))
d = {i: 0 for i in range(1, n + 1)}
for i in range(m):
	(x, y) = map(int, input().split())
	if l[x - 1] > l[y - 1]:
		d[x] += 1
	elif l[y - 1] > l[x - 1]:
		d[y] += 1
a = sorted(l)
r = []
o = 0
for i in l:
	f = bisect_left(a, i)
	r.append(f - d[o + 1])
	o += 1
print(*r)


(n, k) = map(int, input().split())
m = list(map(int, input().split()))
new_m = [(m[i], i) for i in range(n)]
new_m.sort()
ans = [0 for i in range(n)]
last = -1
for i in range(1, len(new_m)):
	if new_m[i][0] == new_m[i - 1][0]:
		ans[new_m[i][1]] = ans[new_m[i - 1][1]]
	else:
		ans[new_m[i][1]] = i
for i in range(k):
	(a, b) = map(int, input().split())
	if m[a - 1] > m[b - 1]:
		ans[a - 1] -= 1
	elif m[a - 1] != m[b - 1]:
		ans[b - 1] -= 1
print(*ans)


from collections import defaultdict as dfd
from bisect import bisect, bisect_left
ans_ = []

def read():
	return list(map(int, input().strip().split(' ')))
(n, k) = read()
arr = read()
s_arr = sorted(arr)
d = dfd(int)
for i in range(k):
	(a, b) = read()
	(x, y) = (arr[a - 1], arr[b - 1])
	if x > y:
		d[a, x] += 1
	elif x < y:
		d[b, y] += 1
ans = []
for i in range(n):
	ind = bisect_left(s_arr, arr[i])
	ans.append(ind - d[i + 1, arr[i]])
ans_.append(ans)
for i in ans_:
	print(*i)


(n, k) = map(int, input().split())
d = {}
a = []
for x in input().split():
	x = int(x)
	if not x in d:
		d[x] = 0
	d[x] += 1
	a.append(x)
lst = sorted(d)
lst.reverse()
d1 = {lst[0]: d[lst[0]]}
for x in range(1, len(lst)):
	d1[lst[x]] = d1[lst[x - 1]] + d[lst[x]]
array = [0] * n
for x in range(n):
	array[x] = n - d1[a[x]]
for x in range(k):
	(l, r) = map(int, input().split())
	if a[l - 1] > a[r - 1]:
		array[l - 1] -= 1
	elif a[l - 1] < a[r - 1]:
		array[r - 1] -= 1
print(*array)


(n, k) = map(int, input().split())
R = list(map(int, input().split()))
C = [0] * n
for i in range(k):
	(x, y) = map(int, input().split())
	(x, y) = (x - 1, y - 1)
	if R[x] > R[y]:
		C[x] -= 1
	elif R[y] > R[x]:
		C[y] -= 1
A = []
for r in R:
	A.append(r)
A.sort()
import bisect
for (i, r) in enumerate(R):
	j = bisect.bisect_left(A, r)
	C[i] += j
print(*C)


def main():
	(n, k) = map(int, input().split(' '))
	rs = list(enumerate(map(int, input().split(' '))))
	pairs = []
	for i in range(k):
		(x, y) = map(int, input().split(' '))
		pairs.append((x, y))
	rating = dict(rs)
	rs.sort(key=lambda x: x[1])
	counts = dict(((x, 0) for x in range(n)))
	cnt = 0
	r_prev = None
	for (l, (m, r)) in enumerate(rs):
		if r != r_prev:
			cnt = l
		counts[m] = cnt
		r_prev = r
	for (a, b) in pairs:
		ra = rating[a - 1]
		rb = rating[b - 1]
		if ra > rb:
			counts[a - 1] -= 1
		elif ra < rb:
			counts[b - 1] -= 1
	print(' '.join(map(str, counts.values())))
main()


from collections import defaultdict
graph = defaultdict(list)
freq = defaultdict(int)
(n, k) = list(map(int, input().split()))
arr = list(map(int, input().split()))
ans = [0 for i in range(n)]
ar1 = []
for i in range(n):
	ar1.append([arr[i], i])
ar1.sort()
for i in range(k):
	(u, v) = list(map(int, input().split()))
	u -= 1
	v -= 1
	graph[u].append(v)
	graph[v].append(u)
for i in range(n):
	(cur, idx) = (ar1[i][0], ar1[i][1])
	prev = max(0, i - freq[cur])
	for j in graph[idx]:
		if arr[j] < cur:
			prev -= 1
	prev = max(prev, 0)
	ans[idx] = prev
	freq[cur] += 1
print(*ans)


import sys
import os.path

def solve():
	(n, k) = map(int, input().split())
	r = list(map(int, input().split()))
	quar = [[] for x in range(n)]
	ord = sorted(map(int, range(n)), key=lambda i: r[i])
	for q in range(k):
		(x, y) = map(int, input().split())
		(x, y) = (x - 1, y - 1)
		quar[x].append(y)
		quar[y].append(x)
	ans = [0] * n
	cnt = {}
	for i in range(n):
		j = ord[i]
		ans[j] = i - cnt.get(r[j], 0)
		for y in quar[j]:
			ans[j] -= 1 if r[j] > r[y] else 0
		if r[j] in cnt:
			cnt[r[j]] += 1
		else:
			cnt[r[j]] = 1
	for i in range(n):
		print(ans[i], end=' ')

def main():
	if os.path.exists('test.inp'):
		sys.stdin = open('test.inp', 'r')
	solve()
main()


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd
from collections import deque
from bisect import bisect_left
(n, k) = map(int, input().split())
l = list(map(int, input().split()))
d = {i: set() for i in range(1, n + 1)}
for i in range(n):
	l[i] = [l[i], i + 1]
l.sort()
s = set()
t = set()
ans = [0 for i in range(n)]
prev = 0
graph = dict(d)
for i in range(k):
	(x, y) = map(int, input().split())
	d[x].add(y)
	d[y].add(x)
for i in range(n):
	if l[i][0] > prev:
		for j in t:
			s.add(j)
		t = set()
		count = 0
		for j in graph[l[i][1]]:
			if j in s:
				count += 1
		ans[l[i][1] - 1] = max(0, len(s) - count)
	else:
		count = 0
		for j in graph[l[i][1]]:
			if j in s:
				count += 1
		ans[l[i][1] - 1] = max(0, len(s) - count)
	t.add(l[i][1])
	prev = l[i][0]
print(*ans)


import bisect
import math
import collections
import sys
from functools import reduce
import decimal
sys.setrecursionlimit(10 ** 9)
decimal.getcontext().rounding = decimal.ROUND_HALF_UP
graphDict = collections.defaultdict
queue = collections.deque

class Graphs:

	def __init__(self):
		self.graph = graphDict(list)

	def add_edge(self, u, v):
		self.graph[u].append(v)

	def dfs_utility(self, nodes, visited_nodes):
		visited_nodes.add(nodes)
		for neighbour in self.graph[nodes]:
			if neighbour not in visited_nodes:
				self.dfs_utility(neighbour, visited_nodes)
			else:
				return neighbour

	def dfs(self, node):
		Visited = set()
		self.dfs_utility(node, Visited)

	def bfs(self, node):
		visited = set()
		if node not in visited:
			queue.append(node)
			visited.add(node)
		while queue:
			parent = queue.popleft()
			print(parent)
			for item in self.graph[parent]:
				if item not in visited:
					queue.append(item)
					visited.add(item)

def rounding(n):
	return int(decimal.Decimal(f'{n}').to_integral_value())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def inp():
	return sys.stdin.readline().strip()

def map_inp(v_type):
	return map(v_type, inp().split())

def list_inp(v_type):
	return list(map_inp(v_type))
(n, k) = map_inp(int)
arr = list_inp(int)
arr_copy = sorted(arr)
result = [bisect.bisect_left(arr_copy, item) for item in arr]
for i in range(k):
	(a, b) = map_inp(int)
	if arr[a - 1] < arr[b - 1]:
		result[b - 1] -= 1
	elif arr[a - 1] > arr[b - 1]:
		result[a - 1] -= 1
print(*result)


import sys
from collections import defaultdict
(n, _) = map(int, next(sys.stdin).rstrip().split())
skills = list(map(int, next(sys.stdin)[:-1].split()))
skills2id = defaultdict(set)
for (i, s) in enumerate(skills, 1):
	skills2id[s].add(i)
id2enemies = defaultdict(set)
for line in sys.stdin:
	(id1, id2) = map(int, line.rstrip().split())
	id2enemies[id1].add(id2)
	id2enemies[id2].add(id1)
result = {}
sorted_skills = sorted(set(skills))
current_set_of_candidates = set(skills2id[sorted_skills[0]])
for c in current_set_of_candidates:
	result[c] = 0
for s in sorted_skills[1:]:
	candidates = skills2id[s]
	for c in candidates:
		result[c] = len(current_set_of_candidates)
		result[c] -= sum((enemy in current_set_of_candidates for enemy in id2enemies[c]))
	for c in candidates:
		current_set_of_candidates.add(c)
for i in range(1, n + 1):
	print(result[i], end=' ')
print()


import sys, bisect
read = lambda : map(int, sys.stdin.buffer.readline().split())
(n, k) = read()
r = list(read())
v = r.copy()
v.sort()
t = [bisect.bisect_left(v, x) for x in r]
for _ in range(k):
	(a, b) = read()
	a -= 1
	b -= 1
	if r[a] > r[b]:
		t[a] -= 1
	if r[b] > r[a]:
		t[b] -= 1
print(*t)


(n, k) = map(int, input().split())
skills = [int(i) for i in input().split()]
dic = {}
for x in skills:
	dic[x] = []
for (i, x) in enumerate(skills):
	dic[x].append(i)
s = sorted(list(set(dic.keys())))
ans = [0] * n
curr = len(dic[s[0]])
for i in s[1:]:
	for j in dic[i]:
		ans[j] = curr
	curr += len(dic[i])
for i in range(k):
	a = [int(i) - 1 for i in input().split()]
	b = [skills[i] for i in a]
	if b[0] > b[1]:
		ans[a[0]] -= 1
	elif b[0] < b[1]:
		ans[a[1]] -= 1
print(' '.join([str(i) for i in ans]))


(n, m) = map(int, input().split())
pr = [(int(x), i) for (i, x) in enumerate(input().split())]
res = [0 for _ in range(n)]
for _ in range(m):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if pr[x][0] > pr[y][0]:
		res[x] -= 1
	if pr[y][0] > pr[x][0]:
		res[y] -= 1
p2 = sorted(pr)
same = 0
prev = 0
for j in range(n):
	(x, i) = p2[j]
	if x == prev:
		same += 1
	else:
		same = 0
		prev = x
	res[i] = res[i] + j - same
print(' '.join(map(str, res)))


from itertools import accumulate

def main():
	(n, k) = [int(_) for _ in input().split()]
	skills = [int(_) for _ in input().split()]
	b = [(r, i) for (i, r) in enumerate(skills)]
	b.sort()
	x = 0
	c = [0] * n
	cnt = 0
	for (r, i) in b:
		if r > x:
			cnt_less = cnt
		c[i] = cnt_less
		cnt += 1
		x = r
	for _ in range(k):
		(u, v) = [int(_) for _ in input().split()]
		u -= 1
		v -= 1
		if skills[u] > skills[v]:
			c[u] -= 1
		elif skills[v] > skills[u]:
			c[v] -= 1
	print(' '.join(map(str, c)))
main()


from collections import Counter

def binary(x, ar):
	low = 0
	high = len(ar) - 1
	while low <= high:
		mid = (low + high) // 2
		if ar[mid] == x:
			break
		elif ar[mid] < x:
			low = mid + 1
		else:
			high = mid - 1
	return mid
(n, q) = map(int, input().split())
l = list(map(int, input().split()))
frq = dict(Counter(l))
new = sorted(set(l))
look = [frq[new[0]]]
for i in range(1, len(new)):
	look.append(look[i - 1] + frq[new[i]])
d = dict()
for i in range(q):
	(li, r) = map(int, input().split())
	li -= 1
	r -= 1
	if li in d:
		d[li].append(r)
	else:
		d[li] = [r]
	if r in d:
		d[r].append(li)
	else:
		d[r] = [li]
enum = []
for i in range(n):
	x = binary(l[i], new)
	if x == 0:
		sum1 = 0
	else:
		sum1 = look[x - 1]
		if i in d:
			for j in range(len(d[i])):
				if l[d[i][j]] < l[i]:
					sum1 -= 1
	enum.append(sum1)
print(*enum)


import io
import os
from collections import defaultdict
from sys import stdin, stdout

def main():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = sorted([(val, i) for (i, val) in enumerate(a)])
	res = defaultdict(int)
	start = 0
	end = 0
	while start < n:
		while end + 1 < n and b[end + 1][0] == b[start][0]:
			end += 1
		for j in range(start, end + 1):
			res[b[start][0], b[j][1]] = start
		start = end + 1
	for _ in range(k):
		(x, y) = map(int, input().split())
		if a[x - 1] > a[y - 1]:
			res[a[x - 1], x - 1] -= 1
		elif a[x - 1] < a[y - 1]:
			res[a[y - 1], y - 1] -= 1
	print(*(res[val, i] for (i, val) in enumerate(a)))
main()


class programmer:

	def __init__(self, ind, skill):
		self.ind = ind
		self.skill = skill
yoar = list(map(int, input().split()))
n = yoar[0]
k = yoar[1]
skillar = list(map(int, input().split()))
skillar.insert(0, 0)
ansar = []
for i in range(n + 1):
	ansar.append(0)
prar = []
abhitak = {}
for i in range(1, n + 1):
	prar.append(programmer(i, skillar[i]))
	abhitak[skillar[i]] = 0
prar.sort(key=lambda programmer: programmer.skill)
prar.insert(0, 0)
dushman = {}
for i in range(1, n + 1):
	dushman[i] = []
for i in range(k):
	yoar = list(map(int, input().split()))
	a = yoar[0]
	b = yoar[1]
	dushman[a].append(b)
	dushman[b].append(a)
for i in range(1, n + 1):
	curr = prar[i]
	curind = curr.ind
	curskill = curr.skill
	curans = i - 1 - abhitak[curskill]
	for j in dushman[curind]:
		if skillar[j] < curskill:
			curans -= 1
	ansar[curind] = curans
	abhitak[curskill] += 1
for i in range(1, n + 1):
	print(ansar[i], end=' ')
print()


from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from collections import defaultdict
import math
cin = stdin.readline

def cout(x):
	stdout.write(str(x) + '\n')

def nexint():
	return int(stdin.readline())

def readline():
	return map(int, stdin.readline().split())

def readlist():
	return list(map(int, stdin.readline().split()))

def sorted_indexes(arr):
	return sorted(range(len(arr)), key=arr.__getitem__)

def printr(arr):
	[stdout.write(str(x) + ' ') for x in arr]
	cout('')

def find_lt(a, x):
	i = bisect_left(a, x)
	if i:
		return a[i - 1]
	raise ValueError

def find_gt(a, x):
	i = bisect_right(a, x)
	if i != len(a):
		return a[i]
	raise ValueError
(n, k) = readline()
arr = readlist()
xx = defaultdict(list)
for _ in range(k):
	(x, y) = readline()
	x -= 1
	y -= 1
	xx[x].append(y)
	xx[y].append(x)
clone = arr[:]
ix = sorted_indexes(arr)
arr.sort()
ans = [0] * n
for i in range(n):
	z = bisect_left(arr, clone[i])
	if z == 0:
		ans[i] = 0
		continue
	for index in xx[i]:
		if clone[index] < clone[i]:
			z -= 1
	ans[i] = z
printr(ans)


from collections import defaultdict
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
enemies = defaultdict(lambda : 0)
r_sort = sorted(r, reverse=True)
for _ in range(k):
	(a, b) = map(int, input().split())
	if r[a - 1] > r[b - 1]:
		enemies[a] += 1
	elif r[b - 1] > r[a - 1]:
		enemies[b] += 1
res = list()
len_r = len(r_sort)
levels = dict()
item = r_sort[0]
for (i, z) in enumerate(r_sort[1:], start=1):
	if item != z:
		levels[item] = len_r - i
		item = z
levels[r_sort[-1]] = 0
print(' '.join(map(str, [levels[z] - enemies[i] for (i, z) in enumerate(r, start=1)])))


def find(num: int):
	global n, k, sed
	(left, right) = (-1, n)
	while right - left > 1:
		mid = (right + left) // 2
		if sed[mid] < num:
			left = mid
		else:
			right = mid
	return right
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
sed = r.copy()
sed.sort()
ans = []
for i in r:
	ans.append(find(i))
for i in range(k):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	if r[a] > r[b]:
		ans[a] -= 1
	elif r[a] < r[b]:
		ans[b] -= 1
print(' '.join(list(map(str, ans))))


class Proger:

	def __init__(self, skill, proger_id):
		self.skill = skill
		self.proger_id = proger_id

	def __repr__(self):
		return '{id}: {skill}'.format(id=self.proger_id, skill=self.skill)
from collections import defaultdict

def main():
	(_, k) = map(int, input().strip().split(' '))
	progers = []
	argues = defaultdict(int)
	counter = 1
	for skill in input().strip().split(' '):
		sk = int(skill)
		progers.append(Proger(sk, counter))
		counter += 1
	skills_sorted = sorted(progers, key=lambda proger: proger.skill)
	for _ in range(k):
		(p1, p2) = map(int, input().strip().split(' '))
		if progers[p1 - 1].skill > progers[p2 - 1].skill:
			argues[p1] += 1
		if progers[p2 - 1].skill > progers[p1 - 1].skill:
			argues[p2] += 1
	padawan_counter = defaultdict(int)
	for idx in range(1, len(skills_sorted)):
		proger = skills_sorted[idx]
		prev_proger = skills_sorted[idx - 1]
		if prev_proger.skill < proger.skill:
			padawan_counter[proger.skill] = idx
	res = []
	for proger in progers:
		res.append(padawan_counter[proger.skill] - argues[proger.proger_id])
	print(' '.join((str(count) for count in res)))
main()


def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] > k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
(n, k) = map(int, input().split())
r = input().split()
ls = []
for i in range(n):
	r[i] = int(r[i])
	ls.append(-r[i])
ls.sort()
ans = [countGreater(ls, n, -r[i]) for i in range(n)]
for i in range(k):
	(u, v) = map(int, input().split())
	if r[u - 1] > r[v - 1]:
		ans[u - 1] -= 1
	elif r[v - 1] > r[u - 1]:
		ans[v - 1] -= 1
print(*ans)


f = lambda : map(int, input().split())
(n, m) = f()
r = list(f())
s = [0] * n
p = sorted(((a, i) for (i, a) in enumerate(r)))
for k in range(n):
	(a, i) = p[k]
	(b, j) = p[k - 1]
	s[i] = s[j] if a == b else k
for i in range(m):
	(a, b) = f()
	a -= 1
	b -= 1
	s[a] -= r[a] > r[b]
	s[b] -= r[b] > r[a]
print(*s)


from copy import copy
(n, k) = map(int, input().split(' '))
l = list(map(int, input().split(' ')))
r = copy(l)
idd = dict()
for i in range(n):
	try:
		idd[l[i]].add(i)
	except:
		idd[l[i]] = {i}
nd = dict()
l.sort()
used = set()
for i in enumerate(l):
	if not i[1] in used:
		for x in idd[i[1]]:
			nd[x] = i[0]
		used.add(i[1])
d = {i: 0 for i in range(n)}
for i in range(k):
	(a, b) = map(lambda x: int(x) - 1, input().split(' '))
	if r[a] < r[b]:
		d[b] += 1
	elif r[b] < r[a]:
		d[a] += 1
for i in range(n):
	print(nd[i] - d[i], end=' ')


(n, k) = map(int, input().split())
r = list(map(int, input().split()))
xy = [tuple(map(lambda _: int(_) - 1, input().split())) for _ in range(k)]
ir = list(enumerate(r))
ir.sort(key=lambda _: (_[1], _[0]))
(a, i, ia) = (0, 0, [[ir[0][0], 0]])
for i in range(1, n):
	if ir[i][1] > ir[i - 1][1]:
		a = i
	ia.append([ir[i][0], a])
ia.sort()
for (x, y) in xy:
	if r[x] > r[y]:
		ia[x][1] -= 1
	if r[x] < r[y]:
		ia[y][1] -= 1
print(*list(map(lambda _: _[1], ia)))


(n, k) = list(map(int, input().split()))
r = list(map(int, input().split()))
r = list(map(lambda x: (x[1], x[0]), enumerate(r)))
a = [0 for i in r]
argues = [[] for i in r]
for i in range(k):
	(x, y) = list(map(int, input().split()))
	argues[x - 1].append(y - 1)
	argues[y - 1].append(x - 1)
	if r[x - 1][0] > r[y - 1][0]:
		a[x - 1] += 1
	elif r[x - 1][0] < r[y - 1][0]:
		a[y - 1] += 1
r.sort()
res = [0 for i in r]
d = {}
for i in range(n):
	answ = i - a[r[i][1]]
	if r[i][0] not in d.keys():
		d[r[i][0]] = 1
	else:
		answ -= d[r[i][0]]
		d[r[i][0]] += 1
	res[r[i][1]] = max(0, answ)
for i in res:
	print(i, end=' ')


from bisect import bisect_left
(n, k) = map(int, input().split())
r = [int(x) for x in input().split()]
r_sorted = sorted(r.copy())
ans = [0] * n
d = {}
for i in range(n):
	d[i] = []
for _ in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if r[x] > r[y]:
		d[x].append(y)
	if r[y] > r[x]:
		d[y].append(x)
for i in range(n):
	res = bisect_left(r_sorted, r[i])
	res -= len(d[i])
	if res > 0:
		ans[i] += res
print(*ans)


params = [int(s) for s in input().split(' ')]
n = params[0]
k = params[1]
skills = [int(s) for s in input().split(' ')]
indexes_sorted = [b[0] for b in sorted(enumerate(skills), key=lambda i: i[1])]
bad_relations = {}
for i in range(k):
	items = [int(s) for s in input().split(' ')]
	first = items[0] - 1
	second = items[1] - 1
	if skills[first] > skills[second]:
		bad_relations[first] = bad_relations.get(first, 0) + 1
	elif skills[second] > skills[first]:
		bad_relations[second] = bad_relations.get(second, 0) + 1
num_the_same = 0
results = {}
prev = None
for (idx, index) in enumerate(indexes_sorted):
	skill = skills[index]
	if skill == prev:
		num_the_same += 1
	else:
		num_the_same = 0
	cnt = idx - num_the_same - bad_relations.get(index, 0)
	if cnt < 0:
		cnt = 0
	results[index] = cnt
	prev = skill
final = ''
for i in range(n):
	final += str(results[i]) + ' '
print(final.strip())


from sys import stdin
a = lambda : input().split()
(n, k) = map(int, a())
lst = [*map(int, a())]
d = {_: 0 for _ in range(1, n + 1)}
for _ in range(k):
	(x, y) = map(int, a())
	if lst[x - 1] > lst[y - 1]:
		d[x] += 1
	if lst[y - 1] > lst[x - 1]:
		d[y] += 1
mas = list(lst)
mas.sort()
res = []
app = res.append
from bisect import bisect_left as bis
for (i, x) in enumerate(lst):
	app(bis(mas, x) - d[i + 1])
print(*res)


import sys
from bisect import bisect_left

def binary_search(a, x, lo=0, hi=None):
	hi = hi if hi is not None else len(a)
	pos = bisect_left(a, x, lo, hi)
	return pos if pos != hi and a[pos] == x else -1

def main():
	inp = input().split()
	number_of_programmers = int(inp[0])
	number_of_pairs = int(inp[1])
	number_of_programmers_can_help = [0] * number_of_programmers
	programmers_hability_unordered = [0] * number_of_programmers
	hability = input().split()
	for i in range(0, number_of_programmers):
		programmers_hability_unordered[i] = int(hability[i])
	programmers_hability_ordered = programmers_hability_unordered.copy()
	programmers_hability_ordered.sort()
	for i in range(0, number_of_programmers):
		position = int((number_of_programmers - 1) / 2)
		position = binary_search(programmers_hability_ordered, programmers_hability_unordered[i])
		number_of_programmers_can_help[i] = position
		index = 1
		if position != 0:
			while programmers_hability_ordered[position] == programmers_hability_ordered[position - index]:
				number_of_programmers_can_help[i] -= 1
				index += 1
	number_of_programmers_untouched = number_of_programmers_can_help.copy()
	for i in range(0, number_of_pairs):
		quarrel = input().split()
		p1 = int(quarrel[0]) - 1
		p2 = int(quarrel[1]) - 1
		if number_of_programmers_untouched[p1] > number_of_programmers_untouched[p2]:
			number_of_programmers_can_help[p1] -= 1
		elif number_of_programmers_untouched[p1] < number_of_programmers_untouched[p2]:
			number_of_programmers_can_help[p2] -= 1
	for i in range(0, number_of_programmers):
		sys.stdout.write(str(number_of_programmers_can_help[i]) + ' ')
main()


def binsearch(nums, target):
	left = 0
	right = len(nums) - 1
	while left <= right:
		mid = (left + right) // 2
		if nums[mid] == target:
			return mid
		elif nums[mid] > target:
			right = mid - 1
		elif nums[mid] < target:
			left = mid + 1
	return left
(n, k) = map(int, input().split())
arr = [int(z) for z in input().split()]
sortedarr = sorted(arr)
quarrels = []
for q in range(k):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	quarrels.append([a, b])
res = {}
for i in range(n):
	pl = binsearch(sortedarr, arr[i] - 0.1)
	res[i] = pl
for i in quarrels:
	(a, b) = i
	a -= 1
	b -= 1
	if arr[a] < arr[b]:
		res[b] -= 1
	if arr[b] < arr[a]:
		res[a] -= 1
print(*res.values())


import sys, bisect
input = lambda : sys.stdin.readline().strip('\r\n')
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
a = sorted(r)
e = [[] for _ in range(n)]
for _ in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	e[x].append(y)
	e[y].append(x)
for i in range(n):
	ind = bisect.bisect_left(a, r[i])
	for j in e[i]:
		if r[j] < r[i]:
			ind -= 1
	print(ind, end=' ')


from bisect import bisect_left as bs
rd = lambda : map(int, input().split())
(n, k) = rd()
r = list(rd())
a = sorted(r)
d = [0] * n
for _ in range(k):
	(x, y) = rd()
	x -= 1
	y -= 1
	p = r[x] - r[y]
	if p < 0:
		d[y] += 1
	if p > 0:
		d[x] += 1
print(*map(lambda x: bs(a, r[x]) - d[x], range(n)))


(n, k) = map(int, input().split())
li = [*map(int, input().split())]
lis = sorted(range(len(li)), key=lambda k: li[k])
ans = [0] * n
j = 0
for i in range(1, len(lis)):
	if li[lis[i - 1]] != li[lis[i]]:
		ans[lis[i]] = i
	else:
		ans[lis[i]] = ans[lis[i - 1]]
for i in range(k):
	(a, b) = map(int, input().split())
	if li[a - 1] > li[b - 1]:
		ans[a - 1] -= 1
	elif li[a - 1] < li[b - 1]:
		ans[b - 1] -= 1
print(*ans)


def main():
	(n, k) = map(int, input().split())
	g = []
	for i in range(n):
		g.append([])
	a = list(map(int, input().split()))
	b = []
	for i in range(n):
		b.append([a[i], i])
	b.sort()
	m = {}
	count = 0
	for i in range(n):
		if i != 0 and b[i][0] == b[i - 1][0]:
			count += 1
		else:
			count = 0
		m[b[i][1]] = i - count
	for i in range(k):
		(u, v) = map(int, input().split())
		g[u - 1].append(v - 1)
		g[v - 1].append(u - 1)
	ans = [0] * n
	for i in range(n):
		s = m[i]
		for el in g[i]:
			if m[el] < m[i]:
				s -= 1
		ans[i] = s
	for i in range(n):
		print(ans[i], end=' ')
main()


(n, e) = map(int, input().split())
r = list(map(int, input().split()))
d = [0] * n
for ee in range(e):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if r[x] == r[y]:
		continue
	if r[x] < r[y]:
		(x, y) = (y, x)
	d[x] += 1
inds = sorted(range(n), key=lambda i: r[i])
j = 0
ans = [0] * n
for i in inds:
	while r[inds[j]] < r[i]:
		j += 1
	ans[i] = j - d[i]
print(*ans)


from collections import Counter
N = 200000.0 + 5
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
num = [0] * n
while k > 0:
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if r[x] > r[y]:
		num[x] += 1
	elif r[y] > r[x]:
		num[y] += 1
	k -= 1
ans = [0] * n
rr = sorted(r)
import bisect
for (i, t) in enumerate(r):
	p = bisect.bisect_left(rr, t)
	ans[i] = p - num[i]
res = ''
for x in ans:
	res += str(x) + ' '
res = res[:res.__len__() - 1]
print(res)


from collections import Counter, defaultdict
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
ans = [0] * n
for _ in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if a[x] > a[y]:
		ans[x] -= 1
	elif a[x] < a[y]:
		ans[y] -= 1
d = Counter(a)
res = sorted(d)
pre = [0] * len(res)
for i in range(1, len(res)):
	pre[i] = pre[i - 1] + d[res[i - 1]]
for i in range(len(res)):
	d[res[i]] = pre[i]
for i in range(n):
	ans[i] += d[a[i]]
print(*ans)


from collections import Counter
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
import math

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def divs(n, start=2):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors
import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())
import sys
from bisect import bisect_left

def main():
	(n, k) = get_ints()
	arr = get_array()
	ans = [0 for i in range(n)]
	for i in range(k):
		(u, v) = get_ints()
		u -= 1
		v -= 1
		if arr[u] > arr[v]:
			ans[u] -= 1
		elif arr[v] > arr[u]:
			ans[v] -= 1
	arr = list(enumerate(arr))
	from operator import itemgetter
	arr.sort(key=itemgetter(1))
	count = {}
	for i in range(n):
		ans[arr[i][0]] += i
		if arr[i][1] in count:
			ans[arr[i][0]] -= count[arr[i][1]]
			count[arr[i][1]] += 1
		else:
			count[arr[i][1]] = 1
	for i in range(n):
		if ans[i] < 0:
			ans[i] = 0
	print(*ans)
main()


(n, k) = map(int, input().split())
r = list(map(int, input().split()))
h = sorted(r)
dic = dict()
dic[h[0]] = 0
for i in range(1, n):
	if h[i - 1] != h[i]:
		dic[h[i]] = i
out = [dic[r[i]] for i in range(n)]
for i in range(k):
	(a, b) = map(lambda i: int(i) - 1, input().split())
	if r[a] > r[b]:
		out[a] -= 1
	elif r[a] < r[b]:
		out[b] -= 1
for i in out:
	print(i, end=' ')


import bisect as bi
import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(n, k) = I()
l = [0] + I()
temp = l.copy()
te = [0] * (n + 1)
temp.sort()
for i in range(k):
	(x, y) = I()
	if l[x] > l[y]:
		te[x] += 1
	if l[y] > l[x]:
		te[y] += 1
an = []
for i in range(1, n + 1):
	x = bi.bisect_left(temp, l[i]) - te[i] - 1
	an.append(x)
print(*an)


import bisect
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
t = sorted(r)
l = [0] * n
for i in range(k):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	if r[a] > r[b]:
		l[a] += 1
	elif r[a] < r[b]:
		l[b] += 1
for i in range(n):
	print(bisect.bisect_left(t, r[i]) - l[i], end=' ')


(a, s) = list(map(int, input().split()))
q = list(map(lambda x: (int(x[1]), int(x[0])), enumerate(input().split())))
q.sort()
poi = [(0, q[0][1])]
w = 0
voc = {}
for (r, i) in q:
	voc[i] = r
for (i, r) in enumerate(q[1:]):
	if q[i][0] == r[0]:
		poi.append((w, r[1]))
	else:
		w = i + 1
		poi.append((w, r[1]))
poi.sort(key=lambda x: x[1])
poi = list(map(lambda x: x[0], poi))
for i in range(s):
	(h, t) = list(map(int, input().split()))
	if voc[h - 1] > voc[t - 1]:
		poi[h - 1] -= 1
	elif voc[t - 1] > voc[h - 1]:
		poi[t - 1] -= 1
poi = list(map(str, poi))
print(*poi)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
ans = [0] * n
for i in range(k):
	(x, y) = [int(j) - 1 for j in input().split()]
	if a[x] < a[y]:
		ans[y] -= 1
	if a[x] > a[y]:
		ans[x] -= 1
d = {}
e = {}
f = {}
for i in a:
	d[i] = 0
	f[i] = True
	e[i] = 0
for i in a:
	d[i] += 1
	e[i] += 1
wk1 = [i for i in a]
wk1.sort()
for i in range(n):
	if f[wk1[i]] and wk1[i] != wk1[0]:
		d[wk1[i]] += d[wk1[i - 1]]
		f[wk1[i]] = False
for i in range(n):
	ans[i] += d[a[i]] - e[a[i]]
for i in range(n):
	if i != n - 1:
		print(ans[i], end=' ')
	else:
		print(ans[i])


(n, k) = list(map(int, input().split()))
r = list(map(int, input().split()))
index = sorted(range(n), key=lambda x: r[x])
m = [0 for _ in range(n)]
ls = 0
seq = 1
for i in range(1, n):
	if r[index[i]] > r[index[i - 1]]:
		ls += seq
		seq = 1
	if r[index[i]] == r[index[i - 1]]:
		seq += 1
	m[index[i]] = ls
for _ in range(k):
	(i, j) = list(map(int, input().split()))
	i -= 1
	j -= 1
	if r[i] < r[j]:
		m[j] -= 1
	elif r[i] > r[j]:
		m[i] -= 1
print(' '.join([str(x) for x in m]))


(n, k) = map(int, input().split())
r = list(map(int, input().split()))
a = []
d = dict()
for i in range(n):
	a.append([r[i], i + 1])
a.sort()
summ = 0
cur = 1
for i in range(n):
	if i >= 1 and a[i - 1][0] != a[i][0]:
		summ += cur
		cur = 1
	elif i >= 1 and a[i - 1][0] == a[i][0]:
		cur += 1
	a[i].append(summ)
	d[a[i][1]] = i
for i in range(k):
	(x, y) = map(int, input().split())
	x = d[x]
	y = d[y]
	if a[x][0] > a[y][0]:
		a[x][2] -= 1
	elif a[y][0] > a[x][0]:
		a[y][2] -= 1

def f(x):
	return x[1]
a.sort(key=f)
for i in range(n):
	print(a[i][2], end=' ')


R = lambda : map(int, input().split())
(n, k) = R()
r = list(R())
h = sorted(r)
d = {}
d[h[0]] = 0
for i in range(1, n):
	if h[i - 1] != h[i]:
		d[h[i]] = i
res = [0] * n
for i in range(n):
	res[i] = d[r[i]]
for i in range(k):
	(a, b) = R()
	a -= 1
	b -= 1
	if r[a] > r[b]:
		res[a] -= 1
	elif r[a] < r[b]:
		res[b] -= 1
res = list(map(str, res))
print(' '.join(res))


(n, k) = map(int, input().split())
a = [*map(int, input().split())]
li = []
rep = {}
res = [0] * n
for i in range(n):
	li.append((a[i], i))
li.sort()
b = [[] for i in range(n)]
for i in range(k):
	(x, y) = map(int, input().split())
	b[x - 1].append(y - 1)
	b[y - 1].append(x - 1)
for i in range(n):
	f = rep.get(li[i][0], 0)
	ans = i - f
	rep[li[i][0]] = rep.get(li[i][0], 0) + 1
	c = 0
	for j in b[li[i][1]]:
		if a[j] < li[i][0]:
			c += 1
	ans -= c
	res[li[i][1]] = ans
print(*res)


import collections

def solve(n, k, skills, quarrels):
	skillIndices = [[skill, i] for (i, skill) in enumerate(skills, 1)]
	skillIndices.sort()
	seen = collections.defaultdict(int)
	results = [0 for _ in range(n)]
	for (x, (skill, index)) in enumerate(skillIndices):
		x -= seen[skill]
		for quarrelingProgrammer in quarrels[index]:
			if skill > skills[quarrelingProgrammer - 1]:
				x -= 1
		seen[skill] += 1
		results[index - 1] = x
	return results
[n, k] = list(map(int, input().strip().split()))
skills = list(map(int, input().strip().split()))
quarrels = collections.defaultdict(set)
for _ in range(k):
	[u, v] = list(map(int, input().strip().split()))
	quarrels[u].add(v)
	quarrels[v].add(u)
print(' '.join(map(str, solve(n, k, skills, quarrels))))


from sys import stdin, stdout
import math
(N, K) = [int(x) for x in stdin.readline().split()]
arr = [int(x) for x in stdin.readline().split()]
a = sorted(arr)
freq = {}
for i in range(N):
	num = a[i]
	if a[i] not in freq:
		freq[a[i]] = i
edge = {}
ans = [0] * N
for i in range(K):
	(u, v) = [int(x) for x in stdin.readline().split()]
	u -= 1
	v -= 1
	if arr[u] > arr[v]:
		ans[u] -= 1
	elif arr[v] > arr[u]:
		ans[v] -= 1
for i in range(N):
	ans[i] += freq[arr[i]]
print(*ans)


import bisect
l = input().split()
n = int(l[0])
k = int(l[1])
l = input().split()
li = [int(i) for i in l]
howmuch = [0 for i in range(n)]
for you in range(k):
	l = input().split()
	u = int(l[0])
	v = int(l[1])
	if li[u - 1] > li[v - 1]:
		howmuch[u - 1] += 1
	elif li[v - 1] > li[u - 1]:
		howmuch[v - 1] += 1
copy = list(li)
li.sort()
for i in range(n):
	z = bisect.bisect_left(li, copy[i]) - howmuch[i]
	print(z, end=' ')


from collections import Counter
(n, k) = map(int, input().split())
R = list(map(int, input().split()))
q = [[] for _ in range(n)]
for _ in range(k):
	(x, y) = map(int, input().split())
	q[min(x, y) - 1].append(max(x, y) - 1)
	q[max(x, y) - 1].append(min(x, y) - 1)
cnt = Counter(R)
keys = list(cnt.keys())
keys.sort(reverse=True)
d = {}
p = 0
for key in keys:
	d[key] = n - cnt[key]
	d[key] -= p
	p += cnt[key]
ans = [0] * n
for i in range(n):
	ans[i] = d[R[i]]
	for j in q[i]:
		if R[i] > R[j]:
			ans[i] -= 1
print(*ans)


(n, k) = map(int, input().split())
lst = [int(x) for x in input().split()]
cnt = [0] * n
for x in range(k):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	if lst[a] < lst[b]:
		cnt[b] += 1
	elif lst[a] > lst[b]:
		cnt[a] += 1
v = []
for x in range(n):
	v.append((lst[x], x))
v.sort()
ans = [0] * n
ans[v[0][1]] = 0
cnt0 = 0
for x in range(1, n):
	if v[x][0] == v[x - 1][0]:
		cnt0 += 1
	else:
		cnt0 = 0
	ans[v[x][1]] = x - cnt0 - cnt[v[x][1]]
print(*ans)


(n, k) = [int(s) for s in input().split()]
r = [int(s) for s in input().split()]
q = [0] * n
for i in range(k):
	(x, y) = [int(s) - 1 for s in input().split()]
	if r[x] > r[y]:
		q[x] += 1
	if r[y] > r[x]:
		q[y] += 1
r1 = []
for i in range(n):
	r1.append((r[i], i))
r1.sort()
lower = 0
ans = [0] * n
for i in range(n):
	if i > 0 and r1[i][0] > r1[i - 1][0]:
		lower = i
	ans[r1[i][1]] = lower - q[r1[i][1]]
print(*ans, sep=' ')


from collections import defaultdict
(n, k) = list(map(int, input().strip().split()))
r = list(map(int, input().strip().split()))
r_l = []
for i in range(1, n + 1):
	r_l.append([i, r[i - 1]])
r_l.sort(key=lambda x: x[1])
d = {}
c = []
for i in range(k):
	(x, y) = list(map(int, input().strip().split()))
	if r[x - 1] < r[y - 1]:
		d[y] = d.get(y, 0) + 1
	elif r[x - 1] > r[y - 1]:
		d[x] = d.get(x, 0) + 1
count = {}
for i in range(n):
	(j, val) = r_l[i]
	tmp = i
	if val in count:
		tmp = count[val]
	else:
		count[val] = i
	cur = max(0, tmp - d.get(j, 0))
	r_l[i].append(cur)
r_l.sort(key=lambda x: x[0])
res = []
for i in range(len(r_l)):
	res.append(str(r_l[i][2]))
print(' '.join(res))


import sys
from math import *

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())
(n, k) = mints()
r = list(mints())
a = sorted(r)
res = [0] * n
for i in range(len(r)):
	L = -1
	R = n - 1
	x = r[i]
	while R - L > 1:
		C = (R + L) // 2
		if a[C] < x:
			L = C
		else:
			R = C
	res[i] = L + 1
for i in range(k):
	(x, y) = mints()
	x -= 1
	y -= 1
	if r[x] > r[y]:
		res[x] -= 1
	elif r[x] < r[y]:
		res[y] -= 1
print(*res)


def solve(n, m, a, adj):
	a = sorted(a)
	res = []
	for i in range(n):
		res.append(0)
	equal = 0
	for i in range(n):
		pos = a[i][1]
		if i == 0:
			res[pos] = 0
			continue
		if a[i][0] == a[i - 1][0]:
			equal += 1
		else:
			equal = 0
		res[pos] = i - equal - len(adj[pos])
	for i in res:
		print(i, end=' ')
(n, m) = map(int, input().split())
tmp = list(map(int, input().split()))
a = []
adj = []
for i in range(n):
	a.append((tmp[i], i))
	adj.append([])
for i in range(m):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if a[x][0] < a[y][0]:
		adj[y].append(x)
	elif a[x][0] > a[y][0]:
		adj[x].append(y)
solve(n, m, a, adj)


from collections import deque
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
rr = []
rr.append([0, 0])
for i in range(n):
	rr.append([r[i], i + 1])
rr.sort()
G = [[] for _ in range(n + 1)]
for _ in range(k):
	(a, b) = map(int, input().split())
	G[a].append(b)
	G[b].append(a)
ng = [0] * (n + 1)
cnt = 0
ans = [0] * n
q = deque()
q.append(0)
for i in range(1, n + 1):
	if not rr[i - 1][0] == rr[i][0]:
		while q:
			ng[q.popleft()] = 1
			cnt += 1
	q.append(rr[i][1])
	ngcnt = 0
	for j in G[rr[i][1]]:
		if ng[j]:
			ngcnt += 1
	ans[rr[i][1] - 1] = cnt - ngcnt - 1
print(*ans)


(n, k) = map(int, input().split())
a = input().split()
l = [[int(a[i]), i, 0] for i in range(n)]
s = []
for i in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	s.append([x, y])
	if l[x][0] > l[y][0]:
		l[x][2] += 1
	elif l[x][0] < l[y][0]:
		l[y][2] += 1
l.sort()
p = l[0][0]
k = 1
for i in range(1, n):
	if l[i][0] == p:
		l[i][2] += k
		k += 1
	else:
		k = 1
	p = l[i][0]
r = [0] * n
for i in range(n):
	r[l[i][1]] = max(i - l[i][2], 0)
print(*r)


import sys
from collections import *
import math
input = sys.stdin.readline
(n, k) = [int(x) for x in input().split()]
arr1 = [int(x) for x in input().split()]
h = defaultdict(deque)
h1 = Counter()
while k:
	k -= 1
	(a, b) = [int(x) - 1 for x in input().split()]
	h[a].append(b)
	h[b].append(a)
arr = [0] * n
for i in range(n):
	arr[i] = (arr1[i], i)
arr.sort()
h1[arr[0][1]] = 0
for i in range(1, n):
	if arr[i][0] == arr[i - 1][0]:
		h1[arr[i][1]] = h1[arr[i - 1][1]]
	else:
		h1[arr[i][1]] = i
for i in range(n):
	count = 0
	for j in h[i]:
		if arr1[j] < arr1[i] and h1[j] < h1[i]:
			count += 1
	print(h1[i] - count, end=' ')


from bisect import bisect_left as bisect
(n, k) = map(int, input().split())
x = list(map(int, input().split()))
xs = sorted(x)
r = [bisect(xs, v) for v in x]
for _ in range(k):
	(u, v) = map(int, input().split())
	u -= 1
	v -= 1
	if x[u] > x[v]:
		r[u] -= 1
	elif x[u] < x[v]:
		r[v] -= 1
print(' '.join(map(str, r)))


from bisect import bisect_left
(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
sort_arr = sorted(arr)
ans = [0] * n
for i in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if arr[x] > arr[y]:
		ans[x] -= 1
	if arr[y] > arr[x]:
		ans[y] -= 1
for i in range(n):
	t = bisect_left(sort_arr, arr[i])
	ans[i] += t
	print(ans[i], end=' ')


from collections import defaultdict
(n, k) = input().split()
(n, k) = [int(n), int(k)]
prog_power = defaultdict(set)
prog = []
for (ind, x) in enumerate(input().split()):
	prog_power[int(x)].add(ind + 1)
	prog.append(int(x))
m = defaultdict(set)
for i in range(k):
	(a1, a2) = input().split()
	(a1, a2) = [int(a1), int(a2)]
	if prog[a1 - 1] > prog[a2 - 1]:
		m[a1].add(a2)
	elif prog[a1 - 1] < prog[a2 - 1]:
		m[a2].add(a1)
power = {}
sum = n
for i in sorted(prog_power.keys(), reverse=True):
	sum -= len(prog_power[i])
	power[i] = sum
for (ind, i) in enumerate(prog):
	mentor = power[i] - len(m[ind + 1])
	print(mentor, end=' ')


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
info = [list(map(int, input().split())) for i in range(k)]
graph = [[] for i in range(n)]
for i in range(k):
	(tmp_a, tmp_b) = info[i]
	tmp_a -= 1
	tmp_b -= 1
	if a[tmp_a] == a[tmp_b]:
		continue
	if a[tmp_a] < a[tmp_b]:
		(tmp_a, tmp_b) = (tmp_b, tmp_a)
	graph[tmp_a].append(tmp_b)
ans = [0] * n
a = sorted(zip(a, range(len(a))))
cnt = 0
for i in range(n):
	if i - 1 >= 0 and a[i][0] != a[i - 1][0]:
		cnt = i
	ans[a[i][1]] = cnt - len(graph[a[i][1]])
print(*ans)


(n, k) = list(map(int, input().split()))
arr = list(map(int, input().split()))
person_to_skill = {}
skill_to_numMentor = {}
person_to_numMentor = {}
for person in range(len(arr)):
	person_to_skill[person] = arr[person]
arr = sorted(arr)
temp = -1
for i in range(len(arr)):
	if arr[i] != temp:
		skill_to_numMentor[arr[i]] = i
		temp = arr[i]
for person in range(n):
	person_to_numMentor[person] = skill_to_numMentor[person_to_skill[person]]
for quarrel in range(k):
	(p1, p2) = list(map(int, input().split()))
	if person_to_skill[p1 - 1] > person_to_skill[p2 - 1]:
		person_to_numMentor[p1 - 1] -= 1
	if person_to_skill[p2 - 1] > person_to_skill[p1 - 1]:
		person_to_numMentor[p2 - 1] -= 1
s = ''
s += str(person_to_numMentor[0])
for i in range(1, n):
	s += ' ' + str(person_to_numMentor[i])
print(s)


from sys import stdin, stdout
input = stdin.readline
t = 1
for _ in range(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	pairs = []
	for i in range(n):
		pairs.append((a[i], i))
	pairs = sorted(pairs, key=lambda x: x[0])
	val = 0
	st = pairs[0][0]
	ans = [0 for x in range(n)]
	c = 0
	for i in range(n):
		if pairs[i][0] == st:
			ans[pairs[i][1]] = val
		else:
			st = pairs[i][0]
			val = c
			ans[pairs[i][1]] = val
		c += 1
	for i in range(k):
		(x, y) = map(int, input().split())
		x -= 1
		y -= 1
		if a[x] > a[y]:
			ans[x] -= 1
		elif a[x] < a[y]:
			ans[y] -= 1
	print(*ans)


(n, k) = map(int, input().split())
r = list(map(int, input().split()))
d = dict()
for i in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if r[x] > r[y]:
		if not d.get(x, False):
			d[x] = [y]
		else:
			d[x].append(y)
	if r[y] > r[x]:
		if not d.get(y, False):
			d[y] = [x]
		else:
			d[y].append(x)
for i in range(n):
	r[i] = (r[i], i)
r.sort(key=lambda x: x[0])
dp = [0] * n
for i in range(1, n):
	if r[i][0] > r[i - 1][0]:
		dp[i] = i
	else:
		dp[i] = dp[i - 1]
podp = [0] * n
for i in range(n):
	ind = r[i][1]
	podp[ind] = dp[i]
	if d.get(ind, False):
		podp[ind] -= len(d[ind])
print(*podp)


from sys import stdout, stdin, setrecursionlimit
from io import BytesIO, IOBase
from collections import *
from itertools import *
from random import *
from bisect import *
from string import *
from queue import *
from heapq import *
from math import *
from re import *
from os import *

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))

def fast():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in fast().split()]
(z, zz) = (fast, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer, end='\n'):
	stdout.write(str(answer) + end)
dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]
(n, m) = zzz()
arr = zzz()
newArr = [[i, j] for (j, i) in enumerate(arr)]
newArr = sorted(newArr)
for _ in range(m):
	(x, y) = zzz()
	x -= 1
	y -= 1
	try:
		graph[x].append(y)
	except:
		graph[x] = [y]
	try:
		graph[y].append(x)
	except:
		graph[y] = [x]
new = {}
cnt = 0
for i in range(n):
	if i != 0 and newArr[i][0] == newArr[i - 1][0]:
		cnt += 1
	else:
		cnt = 0
	new[newArr[i][1]] = i - cnt
ans = [0] * n
for i in range(n):
	idx = newArr[i][1]
	num = newArr[i][0]
	res = new[idx]
	try:
		for j in graph[idx]:
			if num > arr[j]:
				res -= 1
	except:
		pass
	ans[idx] = res
print(*ans)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
R = lambda : map(int, input().split())
(n, k) = R()
r = list(R())
h = sorted(r)
t = [bl(h, x) for x in r]
for i in range(k):
	(a, b) = R()
	a -= 1
	b -= 1
	if r[a] > r[b]:
		t[a] -= 1
	elif r[a] < r[b]:
		t[b] -= 1
print(*t)


(n, k) = map(int, input().split())
skills = list(map(int, input().split()))
quarrels = [0] * n
for _ in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if skills[x] > skills[y]:
		quarrels[x] += 1
	elif skills[y] > skills[x]:
		quarrels[y] += 1
result = [0] * n
next_p = 1
skills = sorted(enumerate(skills), key=lambda x: -x[1])
for (i, skill) in skills[:-1]:
	while next_p < n and skills[next_p][1] == skill:
		next_p += 1
	result[i] = n - next_p - quarrels[i]
print(' '.join(map(str, result)))


import sys
input = sys.stdin.readline
out = sys.stdout

def main():
	(n, k) = map(int, input().split())
	b = list(map(int, input().split()))
	a = []
	d_stat = {i + 1: 0 for i in range(n)}
	d_values = {i + 1: 0 for i in range(n)}
	for i in range(n):
		a.append((i + 1, b[i]))
		t = d_stat.get(b[i], 0) + 1
		d_stat[b[i]] = t
		d_values[i + 1] = b[i]
	d_graph = {}
	for i in range(k):
		(x, y) = map(int, input().split())
		if x not in d_graph:
			d_graph[x] = {y}
		else:
			d_graph[x].add(y)
		if y not in d_graph:
			d_graph[y] = {x}
		else:
			d_graph[y].add(x)
	a.sort(key=lambda x: x[1])
	d_result = {i + 1: 0 for i in range(n)}
	used = set()
	carry = 0
	for i in range(n):
		if a[i][1] not in used:
			used.add(a[i][1])
			carry = 0
		else:
			carry += 1
		current = i - carry
		estimate = d_values[a[i][0]]
		if a[i][0] in d_graph:
			for k in d_graph[a[i][0]]:
				if d_values[k] < estimate:
					current -= 1
		d_result[a[i][0]] = current
	for k in d_result:
		out.write(str(d_result[k]) + ' ')
main()


(x, y) = [int(i) for i in input().split(' ')]
exp = [[i + 1, int(j), 0] for (i, j) in enumerate(input().split(' '))]
q = {}
exps = {}
scores = {}
exp = sorted(exp, key=lambda y: y[1], reverse=True)
for (j, i) in enumerate(exp):
	exps[i[0]] = i[1]
	scores[i[1]] = j
for i in range(1, y + 1):
	(a, b) = [int(i) for i in input().split(' ')]
	if a not in q:
		q[a] = []
	if b not in q:
		q[b] = []
	if exps[a] > exps[b]:
		q[a].append(b)
	elif exps[b] > exps[a]:
		q[b].append(a)
for i in range(0, len(exp)):
	j = scores[exp[i][1]] - i
	try:
		exp[i][2] = len(exp) - i - j - len(q[exp[i][0]]) - 1
	except:
		exp[i][2] = len(exp) - i - j - 1
exp = sorted(exp, key=lambda y: y[0])
for i in exp:
	print(i[2], end=' ')


from collections import defaultdict
from collections import Counter
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
D = defaultdict(lambda : 0)
for i in range(k):
	(a, b) = map(int, input().split())
	if D[a - 1] == 0:
		D[a - 1] = {b - 1}
	else:
		D[a - 1].add(b - 1)
	if D[b - 1] == 0:
		D[b - 1] = {a - 1}
	else:
		D[b - 1].add(a - 1)
P = Counter(r)
g = sorted(range(n), key=lambda x: r[x], reverse=True)
i = 0
out = []
while i < n - 1:
	s = n - 1 - i - (P[r[g[i]]] - 1)
	P[r[g[i]]] -= 1
	if D[g[i]] != 0:
		for el in D[g[i]]:
			if r[el] < r[g[i]]:
				s -= 1
	out.append([g[i], s])
	i += 1
out.append([g[n - 1], 0])
out = sorted(out, key=lambda x: x[0])
t = [out[i][1] for i in range(n)]
print(*t, sep=' ')


import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

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

def main():
	(n, k) = get_ints()
	arr = get_array()
	ans = [0 for i in range(n)]
	for i in range(k):
		(u, v) = get_ints()
		u -= 1
		v -= 1
		if arr[u] > arr[v]:
			ans[u] -= 1
		elif arr[v] > arr[u]:
			ans[v] -= 1
	arr = list(enumerate(arr))
	from operator import itemgetter
	arr.sort(key=itemgetter(1))
	count = {}
	for i in range(n):
		ans[arr[i][0]] += i
		if arr[i][1] in count:
			ans[arr[i][0]] -= count[arr[i][1]]
			count[arr[i][1]] += 1
		else:
			count[arr[i][1]] = 1
	for i in range(n):
		if ans[i] < 0:
			ans[i] = 0
	print(*ans)
main()


(n, k) = map(int, input().split())
r = [[int(el), 0, i] for (i, el) in enumerate(input().split())]
for _ in range(k):
	(x, y) = map(int, input().split())
	if r[x - 1][0] > r[y - 1][0]:
		r[x - 1][1] += 1
	elif r[x - 1][0] < r[y - 1][0]:
		r[y - 1][1] += 1
r.sort(key=lambda x: x[0])
prev = -1
c = 0
ans = [-1] * n
i = 0
for (el1, el2, el3) in r:
	if el1 == prev:
		c += 1
	else:
		c = 0
	ans[el3] = max(0, i - c - el2)
	i += 1
	prev = el1
print(*ans)


from bisect import *
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
s = sorted(r)
l = [0] * n
for i in range(n):
	l[i] = bisect_left(s, r[i])
for i in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if r[x] < r[y]:
		l[y] -= 1
	elif r[x] > r[y]:
		l[x] -= 1
print(*l)


import sys

def inpu():
	return sys.stdin.readline().strip()
(n, k) = [int(i) for i in inpu().split()]
skill = [int(i) for i in inpu().split()]
spat = [0] * n
for i in range(k):
	(x, y) = [int(i) for i in inpu().split()]
	if skill[x - 1] > skill[y - 1]:
		spat[x - 1] += 1
	elif skill[x - 1] < skill[y - 1]:
		spat[y - 1] += 1
binar = sorted(skill)
for i in range(n):
	h = skill[i]
	k = 0
	low = 0
	high = n - 1
	while low != high:
		mid = (low + high) // 2
		if h > binar[mid]:
			low = mid + 1
		else:
			high = mid
	if low - spat[i] >= 0:
		low -= spat[i]
	print(low, end=' ')


(n, k) = map(int, input().split())
lis = list(map(int, input().split()))
ans = [0] * n
has = [0] * 200006
for _ in range(k):
	(a, b) = map(int, input().split())
	if lis[a - 1] > lis[b - 1]:
		has[a - 1] -= 1
	elif lis[b - 1] > lis[a - 1]:
		has[b - 1] -= 1
c = 1
lis = [[lis[i], i] for i in range(n)]
lis.sort()
for i in range(1, n):
	if lis[i][0] == lis[i - 1][0]:
		ans[lis[i][1]] = i - c + has[lis[i][1]]
		c += 1
	else:
		ans[lis[i][1]] = i + has[lis[i][1]]
		c = 1
print(*ans)


from bisect import bisect_left
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
rr = r[:]
rr.sort()
rem = [0] * n
for _ in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if r[x] < r[y]:
		rem[y] += 1
	if r[x] > r[y]:
		rem[x] += 1
ans = []
for i in range(n):
	ans.append(bisect_left(rr, r[i]) - rem[i])
print(*ans)


import bisect
(n, k) = list(map(int, input().split()))
(r, o) = (list(map(int, input().split())), '')
d = {}
for i in range(k):
	(a, b) = list(map(int, input().split()))
	if [b] != d.setdefault(a, [b]):
		d[a] += [b]
	if [a] != d.setdefault(b, [a]):
		d[b] += [a]
rr = sorted(r)
for i in range(1, n + 1):
	a = bisect.bisect_left(rr, r[i - 1])
	if i in d:
		for j in d[i]:
			if r[j - 1] < r[i - 1]:
				a -= 1
	o += str(a) + ' '
print(o)


(n, m) = map(int, input().split())
li = list(map(int, input().split()))
lis = [[li[i], i] for i in range(n)]
lis.sort()
ans = [0] * n
ans[lis[0][1]] = 0
for i in range(1, n):
	if lis[i][0] != lis[i - 1][0]:
		ans[lis[i][1]] = i
	else:
		ans[lis[i][1]] = ans[lis[i - 1][1]]
for i in range(m):
	(a, b) = map(int, input().split())
	if li[a - 1] > li[b - 1]:
		ans[a - 1] -= 1
	elif li[b - 1] > li[a - 1]:
		ans[b - 1] -= 1
print(*ans)


import sys
input = sys.stdin.readline
(n, k) = map(int, input().split())
ratings = list(map(lambda x: int(x) - 1, input().split()))
q = [0] * n
for _ in range(k):
	(a, b) = map(lambda x: int(x) - 1, input().split())
	d = ratings[a] - ratings[b]
	if d > 0:
		q[a] += 1
	elif d < 0:
		q[b] += 1
res = [0] * n
rating_idx = dict()
for (i, r) in enumerate(ratings):
	if r in rating_idx:
		rating_idx[r].append(i)
	else:
		rating_idx[r] = [i]
cur_count = 0
for r in sorted(rating_idx.keys()):
	for idx in rating_idx[r]:
		res[idx] = cur_count - q[idx]
	cur_count += len(rating_idx[r])
print(*res)


(n, k) = map(int, input().split())
rarr = list(map(int, input().split()))
narr = [(0, r, i) for (i, r) in enumerate(rarr)]
for _ in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	mx = None
	if rarr[x] > rarr[y]:
		t = narr[x]
		narr[x] = (t[0] + 1, t[1], t[2])
	elif rarr[y] > rarr[x]:
		t = narr[y]
		narr[y] = (t[0] + 1, t[1], t[2])
narr.sort(key=lambda x: x[1])
xarr = [0 for _ in narr]
so = 0
for i in range(1, n):
	(q, r, j) = narr[i]
	if r == narr[i - 1][1]:
		so += 1
	else:
		so = 0
	xarr[j] = i - so - q
print(*xarr)


import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
import itertools
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))
(n, k) = inpl()
r = inpl()
rr = [[x, i] for (i, x) in enumerate(r)]
cnt = [0] * n
for _ in range(k):
	(a, b) = inpl()
	(a, b) = (a - 1, b - 1)
	if r[a] > r[b]:
		cnt[a] += 1
	if r[b] > r[a]:
		cnt[b] += 1
res = [0] * n
rr.sort()
can = 0
ind = 0
now = rr[0][0]
now_cnt = 0
while ind < n:
	(x, i) = rr[ind]
	res[i] = can - cnt[i]
	now_cnt += 1
	if ind != n - 1 and rr[ind + 1][0] != now:
		now = rr[ind + 1][0]
		can += now_cnt
		now_cnt = 0
	ind += 1
print(*res)


from collections import defaultdict, deque
import bisect
import math
(x, y) = map(int, input().split())
a = list(map(int, input().split()))
d = defaultdict(int)
d0 = defaultdict(list)
for i in range(x):
	d0[a[i]].append(i + 1)
b = a[:]
a = list(set(a))
a.sort()
s = 0
for i in a:
	for j in d0[i]:
		d[j] += s
	s += len(d0[i])
for i in range(y):
	(a0, b0) = map(int, input().split())
	if b[a0 - 1] > b[b0 - 1]:
		d[a0] -= 1
	if b[a0 - 1] < b[b0 - 1]:
		d[b0] -= 1
for i in range(x):
	print(d[i + 1], end=' ')


(n, k) = map(int, input().split())
r = list(map(int, input().split()))
h = [0] * n
for _ in range(k):
	(a, b) = map(int, input().split())
	if r[a - 1] < r[b - 1]:
		h[b - 1] += 1
	if r[b - 1] < r[a - 1]:
		h[a - 1] += 1
x = [[r[i], i] for i in range(n)]
x.sort()
o = ['0'] * n
u = 0
for i in range(1, n):
	if x[i][0] != x[i - 1][0]:
		u = i
	o[x[i][1]] = str(max(0, u - h[x[i][1]]))
print(' '.join(o))


def First(arr, num):
	lo = 0
	hi = len(arr) - 1
	res = -1
	while lo <= hi:
		mid = int((lo + hi) / 2)
		if num > arr[mid]:
			lo = mid + 1
		elif num < arr[mid]:
			hi = mid - 1
		else:
			res = mid
			hi = mid - 1
	return res
(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
arr_sorted = arr[:]
arr_sorted.sort()
arr_res = arr[:]
for i in range(0, n):
	arr_res[i] = First(arr_sorted, arr[i])
for i in range(0, k):
	(a, b) = map(int, input().split())
	if arr[a - 1] > arr[b - 1]:
		arr_res[a - 1] = arr_res[a - 1] - 1
	elif arr[a - 1] < arr[b - 1]:
		arr_res[b - 1] = arr_res[b - 1] - 1
print(*arr_res)


T = input().split(' ')
n = int(T[0])
k = int(T[1])
S = input().split(' ')
for i in range(len(S)):
	S[i] = (int(S[i]), i)
Q = S.copy()
S.sort()
N = [0] * len(S)
tot = 0
for i in range(1, len(S)):
	if S[i][0] == S[i - 1][0]:
		tot += 1
	else:
		tot = 0
	N[S[i][1]] = i - tot
B = [0] * len(S)
for i in range(k):
	W = input().split(' ')
	a = int(W[0])
	b = int(W[1])
	if Q[a - 1][0] > Q[b - 1][0]:
		B[a - 1] += 1
	if Q[b - 1][0] > Q[a - 1][0]:
		B[b - 1] += 1
for i in range(len(S) - 1):
	print(N[i] - B[i], end=' ')
print(N[n - 1] - B[n - 1])


(n, k) = map(int, input().split())
ar = list(map(int, input().split()))
cross = [0] * n
res = [0] * n
nar = list(sorted([[ar[x], x] for x in range(n)]))
cur = ['1', 0]
for x in nar:
	if x[0] == cur[0]:
		cur[1] += 1
		cross[x[1]] += cur[1]
	else:
		cur[0] = x[0]
		cur[1] = 0
for x in range(k):
	(a, b) = map(lambda x: int(x) - 1, input().split())
	if ar[a] != ar[b]:
		cross[max(a, b, key=lambda x: ar[x])] += 1
for x in range(n):
	res[x] -= cross[x]
	res[nar[x][1]] += x
print(*res)


from sys import stdin
input = stdin.buffer.readline

def func(l, indx):
	ans = -1
	start = 0
	end = indx
	while start <= end:
		mid = (start + end) // 2
		if l[mid][0] >= l[indx][0]:
			end = mid - 1
		else:
			ans = mid
			start = mid + 1
	return ans
(n, k) = map(int, input().split())
arr = [int(x) for x in input().split()]
l = []
for i in range(n):
	l.append((arr[i], i))
l.sort()
dp = [[] for i in range(n)]
for i in range(k):
	(x, y) = map(int, input().split())
	dp[x - 1].append(y - 1)
	dp[y - 1].append(x - 1)
result = [0] * n
for indx in range(n):
	x = func(l, indx)
	if x != -1:
		ll = x + 1
		for j in dp[l[indx][1]]:
			if arr[l[indx][1]] > arr[j]:
				ll = ll - 1
		result[l[indx][1]] = ll
print(*result)


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
from itertools import permutations
I = sys.stdin.readline
alpha = 'abcdefghijklmnopqrstuvwxyz'

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

def mi():
	return map(int, I().strip().split())

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	elif n <= 2:
		return True
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				return False
		return True

def main():
	(n, k) = mi()
	arr = li()
	d = defaultdict(list)
	ans = [0] * n
	for i in range(k):
		(u, v) = mi()
		if arr[u - 1] > arr[v - 1]:
			ans[u - 1] -= 1
		if arr[v - 1] > arr[u - 1]:
			ans[v - 1] -= 1
	tmp = [i for i in arr]
	tmp.sort()
	for i in range(n):
		low = 0
		high = n - 1
		while low < high:
			mid = low + (high - low) // 2
			if tmp[mid] >= arr[i]:
				high = mid
			else:
				low = mid + 1
		ans[i] += high
	print(*ans)
main()


from sys import stdin

def lower_bound(sa, target):
	low = 0
	high = len(sa)
	while low < high:
		mid = low + high >> 1
		if sa[mid] >= target:
			high = mid
		else:
			low = mid + 1
	return low

def main():
	(n, k) = map(int, stdin.readline().split())
	ar = list(map(int, stdin.readline().split()))
	count = [0] * n
	for _ in range(k):
		(x, y) = map(int, stdin.readline().split())
		if ar[x - 1] > ar[y - 1]:
			count[x - 1] += 1
		elif ar[x - 1] < ar[y - 1]:
			count[y - 1] += 1
	sa = sorted(ar)
	for i in range(n):
		i1 = lower_bound(sa, ar[i])
		i2 = count[i]
		print(i1 - i2, end=' ')
	print()
main()


(n, k) = map(int, input().split(' '))
skills = list(map(int, input().split(' ')))
not_mentor = {}
for i in range(k):
	(x, y) = map(int, input().split(' '))
	x -= 1
	y -= 1
	if skills[x] < skills[y]:
		if y in not_mentor.keys():
			not_mentor[y] += 1
		else:
			not_mentor[y] = 1
	elif skills[y] < skills[x]:
		if x in not_mentor.keys():
			not_mentor[x] += 1
		else:
			not_mentor[x] = 1
s = sorted([(skill, i) for (i, skill) in enumerate(skills)])
last_skill = 0
last_i = 0
l = [0] * n
for (i, pack) in enumerate(s):
	(skill, j) = pack
	if last_skill != skill:
		last_i = i
		last_skill = skill
	if j in not_mentor.keys():
		l[j] = last_i - not_mentor[j]
	else:
		l[j] = last_i
print(*l)


def sol():
	(n, w) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	out = [0] * n
	nArr = []

	def heh(el):
		return el[0]
	for i in range(n):
		nArr.append([arr[i], i])
	nArr.sort(key=heh)
	l = 99999999999999
	t = 0
	for i in range(n):
		if nArr[i][0] != l:
			t = 0
			l = nArr[i][0]
		else:
			t += 1
		out[nArr[i][1]] += i - t
	for i in range(w):
		(a, b) = list(map(int, input().split()))
		if arr[a - 1] > arr[b - 1]:
			out[a - 1] -= 1
		if arr[b - 1] > arr[a - 1]:
			out[b - 1] -= 1
	print(*out)
sol()


[n, k] = [int(x) for x in input().split()]
r = [int(x) for x in input().split()]
progs = [[i, x, 0, 0] for (i, x) in enumerate(r)]
IND = 0
RATE = 1
REL = 2
RES = 3
i = 0
while i < k:
	[a, b] = [int(x) for x in input().split()]
	a -= 1
	b -= 1
	if progs[a][RATE] > progs[b][RATE]:
		progs[a][REL] += 1
	if progs[a][RATE] < progs[b][RATE]:
		progs[b][REL] += 1
	i += 1
progs = sorted(progs, key=lambda p: p[RATE])
i = 1
count = 0
while i < n:
	cur = progs[i]
	prev = progs[i - 1]
	if cur[RATE] > prev[RATE]:
		count = i
	cur[RES] = count - cur[REL]
	i += 1
progs = sorted(progs, key=lambda p: p[IND])
for p in progs:
	print(p[RES], end=' ')


import sys
from bisect import bisect_left

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

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
(N, M) = MAP()
A = LIST()
hates = [[] for i in range(N)]
for _ in range(M):
	(a, b) = MAP()
	a -= 1
	b -= 1
	hates[a].append(A[b])
	hates[b].append(A[a])
A2 = sorted(A)
for i in range(N):
	hates[i].sort()
ans = [0] * N
for (i, a) in enumerate(A):
	cnt1 = bisect_left(A2, a)
	cnt2 = bisect_left(hates[i], a)
	ans[i] = cnt1 - cnt2
print(*ans)


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
a = list()
for i in range(n):
	a.append((r[i], i))
a.sort()
d = dict()
for i in range(n):
	if a[i][0] in d:
		d[a[i][0]] = min(d[a[i][0]], i)
	else:
		d[a[i][0]] = i
q = [0] * n
for i in range(k):
	(x, y) = map(int, input().split())
	if r[x - 1] > r[y - 1]:
		q[x - 1] += 1
	elif r[x - 1] < r[y - 1]:
		q[y - 1] += 1
res = [0] * n
for i in range(n):
	less = d[a[i][0]]
	qr = q[a[i][1]]
	res[a[i][1]] = max(0, less - qr)
print(*res)


from bisect import *
R = lambda : map(int, input().split())
(n, k) = R()
r = list(R())
h = sorted(r)
t = [bisect_left(h, x) for x in r]
for i in range(k):
	(a, b) = R()
	a -= 1
	b -= 1
	if r[a] > r[b]:
		t[a] -= 1
	elif r[a] < r[b]:
		t[b] -= 1
print(*t)


import bisect
from collections import defaultdict, Counter
import os
import sys
from io import BytesIO, IOBase
ii = lambda : int(input())
lmii = lambda : list(map(int, input().split()))
slmii = lambda : sorted(map(int, input().split()))
li = lambda : list(input())
mii = lambda : map(int, input().split())
msi = lambda : map(str, input().split())

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

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

def main():
	(n, k) = mii()
	a = lmii()
	(q, s) = (defaultdict(list), sorted(a))
	for i in range(k):
		(q1, q2) = mii()
		q[q1 - 1].append(a[q2 - 1])
		q[q2 - 1].append(a[q1 - 1])
	for i in q:
		q[i] = sorted(q[i])
	for i in range(n):
		print(bisect.bisect_left(s, a[i]) - bisect.bisect_left(q[i], a[i]), end=' ')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


(n, k) = list(map(int, input().split()))
r = list(map(int, input().split()))
b = [0 for i in range(n)]
for i in range(k):
	(x, y) = list(map(int, input().split()))
	if r[x - 1] > r[y - 1]:
		b[x - 1] += 1
	if r[y - 1] > r[x - 1]:
		b[y - 1] += 1
p = r.copy()
p.sort(reverse=True)
c = {}
d = {}
for i in range(n):
	c[p[i]] = 0
for i in range(n):
	c[p[i]] += 1
s = 0
for i in c:
	s = s + c[i]
	d[i] = n - s
a = []
for i in range(n):
	a.append(d[r[i]] - b[i])
print(*a)


from collections import defaultdict
(n, q) = map(int, input().split())
lst = list(map(int, input().split()))
dic = defaultdict(int)
for _ in range(q):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	if lst[a] > lst[b]:
		dic[a] -= 1
	elif lst[b] > lst[a]:
		dic[b] -= 1
slst = list(sorted(lst))
sid = defaultdict(int)
cur = 0
sid[slst[0]] = 0
for i in range(1, len(slst)):
	cur += 1
	if slst[i] == slst[i - 1]:
		continue
	sid[slst[i]] = cur
for i in range(len(lst)):
	print(sid[lst[i]] + dic[i], end=' ')


from bisect import *
R = lambda : map(int, input().split())
(n, k) = R()
r = list(R())
h = sorted(r)
t = [bisect_left(h, x) for x in r]
while k:
	(u1, u2) = R()
	u1 -= 1
	u2 -= 1
	if r[u1] < r[u2]:
		t[u2] -= 1
	if r[u2] < r[u1]:
		t[u1] -= 1
	k -= 1
print(*t)


def main():
	from collections import Counter
	(N, K) = (int(i) for i in input().split())
	R = [int(i) for i in input().split()]
	G = [[] for _ in range(N)]
	for _ in range(K):
		(a, b) = (int(i) - 1 for i in input().split())
		if R[a] > R[b]:
			G[a].append(b)
		elif R[a] < R[b]:
			G[b].append(a)
	mp = Counter()
	ans = [0] * N
	R_sorted = sorted(((r, i) for (i, r) in enumerate(R)))
	for (j, (r, i)) in enumerate(R_sorted):
		cur = j - len(G[i]) - mp[r]
		ans[i] = cur
		mp[r] += 1
	print(*ans)
main()


import bisect
firstLineNum = [int(x) for x in input().split(' ')]
n = firstLineNum[0]
k = firstLineNum[1]
skill = [int(x) for x in input().split(' ')]
ans = [0] * len(skill)
sortedSkill = list(skill)
sortedSkill.sort()
for i in range(k):
	numList = [int(x) for x in input().split(' ')]
	x = numList[0]
	y = numList[1]
	if skill[x - 1] > skill[y - 1]:
		ans[x - 1] -= 1
	elif skill[x - 1] < skill[y - 1]:
		ans[y - 1] -= 1
for (index, p) in enumerate(skill):
	pos = bisect.bisect_left(sortedSkill, p)
	print(pos + ans[index], end=' ')


import sys
input = sys.stdin.readline
from bisect import *
(n, k) = map(int, input().split())
r = list(map(int, input().split()))
sub = [0] * n
for _ in range(k):
	(x, y) = map(int, input().split())
	x -= 1
	y -= 1
	if r[x] > r[y]:
		sub[x] += 1
	if r[y] > r[x]:
		sub[y] += 1
r2 = r[:]
r2.sort()
for i in range(n):
	ans = bisect_left(r2, r[i]) - sub[i]
	if i < n - 1:
		print(ans, end=' ')
	else:
		print(ans)


import sys
import bisect
from math import ceil, floor

def check(k, n):
	fr = 0
	temp = n
	while n > 0:
		if n < k:
			fr = fr + n
			n = 0
		else:
			fr = fr + k
			n = n - k
			n -= n // 10
	return fr * 2 >= temp
RI = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
mod = 10 ** 9 + 7
(n, k) = RI()
a = RI()
lis = [[] for i in range(n)]
for i in range(k):
	(l, r) = RI()
	if a[l - 1] < a[r - 1]:
		lis[r - 1].append(l - 1)
	elif a[l - 1] > a[r - 1]:
		lis[l - 1].append(r - 1)
sor = [[a[i], i] for i in range(len(a))]
sor.sort(key=lambda x: x[0])
cnt = {}
seen = set()
ans = [0] * n
for i in range(len(sor)):
	if sor[i][0] not in cnt:
		cnt[sor[i][0]] = 1
	else:
		cnt[sor[i][0]] += 1
	count = i - (cnt[sor[i][0]] - 1)
	for j in lis[sor[i][1]]:
		if j in seen:
			count -= 1
	ans[sor[i][1]] = count
	seen.add(sor[i][1])
for i in ans:
	print(i, end=' ')
print()


import sys
import io, os
input = sys.stdin.buffer.readline
(n, k) = map(int, input().split())
R = list(map(int, input().split()))
C = [0] * n
for i in range(k):
	(x, y) = map(int, input().split())
	(x, y) = (x - 1, y - 1)
	if R[x] > R[y]:
		C[x] -= 1
	elif R[y] > R[x]:
		C[y] -= 1
A = []
for r in R:
	A.append(r)
A.sort()
import bisect
for (i, r) in enumerate(R):
	j = bisect.bisect_left(A, r)
	C[i] += j
print(*C)


def lei(a):
	l = sorted(zip(a, list(range(len(a)))))
	t = [None] * len(a)
	for (i, e) in enumerate(l):
		t[e[1]] = (e[0], i)
	d = {}
	for e in t:
		if e[0] not in d or d[e[0]] > e[1]:
			d[e[0]] = e[1]
	tt = []
	for e in t:
		tt.append(d[e[0]])
	return tt
a = input().split(' ')
a = [int(e) for e in a]
l = input().split(' ')
l = [int(e) for e in l]
assert a[0] == len(l)
smaller_quarrel = [0] * len(l)
for i in range(a[1]):
	ll = input().split(' ')
	ll = [int(e) for e in ll]
	i1 = ll[0] - 1
	i2 = ll[1] - 1
	if l[i1] > l[i2]:
		smaller_quarrel[i1] += 1
	if l[i2] > l[i1]:
		smaller_quarrel[i2] += 1
tt = lei(l)
for i in range(len(tt)):
	print(tt[i] - smaller_quarrel[i], end=' ')


from sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
from bisect import bisect_left
(n, k) = iia()
arr = iia()
arr1 = sorted(arr)
res = [bisect_left(arr1, i) for i in arr]
for _ in range(k):
	(a, b) = iia()
	(a, b) = (a - 1, b - 1)
	if arr[a] > arr[b]:
		res[a] -= 1
	elif arr[b] > arr[a]:
		res[b] -= 1
print(*res)


(n, k) = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
l_new = []
for i in range(n):
	l_new.append((l[i], i))
l_new = sorted(l_new)
graph = [['o'] for i in range(n)]
for i in range(k):
	(a1, a2) = [int(i) for i in input().split()]
	graph[a1 - 1].append(a2 - 1)
	graph[a2 - 1].append(a1 - 1)
ANS = {}
been = set()
d = {}
for i in l:
	if i not in been:
		been.add(i)
		d[i] = False
for pers in range(n):
	i_pers = l_new[pers][0]
	num_pers = l_new[pers][1]
	ans = pers - d[i_pers]
	ssor = graph[num_pers]
	if len(ssor) > 1:
		for i in range(1, len(ssor)):
			if l[ssor[i]] < i_pers:
				ans -= True
	d[i_pers] += True
	ANS[num_pers] = ans
for i in range(n):
	print(ANS[i], end=' ')
print('\n')


from bisect import bisect_right, bisect_left
R = lambda : map(int, input().split())
(n, m) = R()
rs = list(R())
dup_rs = list(sorted(rs))
ms = [bisect_left(dup_rs, rs[i]) for i in range(n)]
for i in range(m):
	(a, b) = R()
	(a, b) = (a - 1, b - 1)
	if rs[a] > rs[b]:
		ms[a] -= 1
	if rs[b] > rs[a]:
		ms[b] -= 1
for x in ms:
	print(x, end=' ')


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 998244353
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
(n, k) = value()
a = array()
ans = [0] * n
have = sorted(a)
for i in range(n):
	ans[i] += bisect_left(have, a[i])
for i in range(k):
	(x, y) = value()
	x -= 1
	y -= 1
	if a[x] > a[y]:
		ans[x] -= 1
	if a[y] > a[x]:
		ans[y] -= 1
print(*ans)