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 ≤ n ≤ 2 ⋅ 10^5, 0 ≤ k ≤ min(2 ⋅ 10^5, (n ⋅ (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, ..., r_n (1 ≤ r_i ≤ 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 ≤ x, y ≤ n, x ≠ 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.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.stream.Stream;

public class Solution implements Runnable {

	static final long MOD = (long) 1e9 + 7;
	static final Reader in = new Reader();
	static final PrintWriter out = new PrintWriter(System.out);
	StringBuilder answer = new StringBuilder();

	public static void main(String[] args) {
		new Thread(null, new Solution(), "persefone", 1 << 28).start();
	}

	@Override
	public void run() {
		int n = in.nextInt(), k = in.nextInt();
		Node[] node = new Node[n];
		for (int i = 0; i < n; i++)
			node[i] = new Node(in.nextInt(), i);
		Arrays.sort(node, (n1, n2) -> n1.x - n2.x); 
//		printf(node);
		Map<Integer, Set<Integer>> map = new HashMap<>();
		for (int i = 0; i < k; i++) {
			int x = in.nextInt();
			int y = in.nextInt();
			map.computeIfAbsent(x, v -> new HashSet<>()).add(y);
			map.computeIfAbsent(y, v -> new HashSet<>()).add(x);
		}
//		printf(map);
		solve(node, map, n, k);
		printf();
	}

//	@SuppressWarnings("unchecked")
	<T> void solve(Node[] node, Map<Integer, Set<Integer>> map, int n, int k) {
		int[] ans = new int[n];
		Map<Integer, Integer> set = new LinkedHashMap<>();
		set.put(node[0].y + 1, 0);
		for (int i = 1; i < n; i++) {
			int j = node[i].y;
			
			Set<Integer> ns = map.get(j + 1);
			ans[j] = lw(node, 0, i, node[i].x);
			if (ns == null || ns.isEmpty()) {
				
				set.put(j + 1, i);
				continue;
			}
			int pos = ans[j];
	//		printf(ns);
	//		printf(j, pos);
			for (int z : ns) {
				if (set.containsKey(z) && set.get(z) < pos)
					ans[j]--;				
			}
			if (ans[i] < 0) ans[i] = 0;
			set.put(j + 1, i);
		}
		
//		printf(set);
		printf(ans);
	}

	int lw(Node[] node, int l, int r, int k) {
		if (node[r - 1].x < k) return r;
		int m = 0;
		while (l <= r) {
			m = l + r >> 1;
			if (node[m].x >= k)
				r = m - 1;
			else
				l = m + 1;
		}
		return l;
	}

	static class Node {
		int x, y;

		Node(int x, int y) {
			this.x = x;
			this.y = y;
		}
		@Override
		public String toString() {
			return x + " " + y;
		}
	}

	void printf() {
		out.print(answer);
		out.close();
	}

	void printf(Stream<?> str) {
		str.forEach(o -> add(o, " "));
		add("\n");
	}

	void printf(Object... obj) {
		if (obj.getClass().isPrimitive()) {
			add(obj, "\n");
			return;
		}
		if (obj.length > 1) {
			printf(Arrays.stream(obj));
			return;
		}

		if (obj.length == 1) {
			Object o = obj[0];
			if (o instanceof int[])
				printf(Arrays.stream((int[]) o).boxed());
			else if (o instanceof char[])
				printf(String.valueOf(o).chars());
			else if (o instanceof long[])
				printf(Arrays.stream((long[]) o).boxed());
			else if (o instanceof double[])
				printf(Arrays.stream((double[]) o).boxed());
			else
				add(o, "\n");
		}
	}

	void printf(Collection<?> col) {
		printf(col.stream());
	}

	<T, K> void add(T t, K k) {
		if (t instanceof Collection<?>) {
			((Collection<?>) t).forEach(i -> add(i, " "));
		} else if (t instanceof Object[]) {
			Arrays.stream((Object[]) t).forEach(i -> add(i, " "));
		} else
			add(t);
		add(k);
	}

	<T> void add(T t) {
		answer.append(t);
	}

	static class Pair<K extends Comparable<? super K>, V extends Comparable<? super V>>
			implements Comparable<Pair<K, V>> {
		private K k;
		private V v;

		Pair() {
		}

		Pair(K k, V v) {
			this.k = k;
			this.v = v;
		}

		K getK() {
			return k;
		}

		V getV() {
			return v;
		}

		void setK(K k) {
			this.k = k;
		}

		void setV(V v) {
			this.v = v;
		}

		void setKV(K k, V v) {
			this.k = k;
			this.v = v;
		}

		@SuppressWarnings("unchecked")
		@Override
		public boolean equals(Object o) {
			if (this == o)
				return true;
			if (o == null || !(o instanceof Pair))
				return false;
			Pair<K, V> p = (Pair<K, V>) o;
			return k.compareTo(p.k) == 0 && v.compareTo(p.v) == 0;
		}

		@Override
		public int hashCode() {
			int hash = 31;
			hash = hash * 89 + k.hashCode();
			hash = hash * 89 + v.hashCode();
			return hash;
		}

		@Override
		public int compareTo(Pair<K, V> pair) {
			return k.compareTo(pair.k) == 0 ? v.compareTo(pair.v) : k.compareTo(pair.k);
		}

		@Override
		public Pair<K, V> clone() {
			return new Pair<K, V>(this.k, this.v);
		}

		@Override
		public String toString() {
			return String.valueOf(k).concat(" ").concat(String.valueOf(v)).concat("\n");
		}
	}

	static class Reader {
		private BufferedReader br;
		private StringTokenizer st;

		Reader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			try {
				while (st == null || !st.hasMoreTokens()) {
					st = new StringTokenizer(br.readLine());
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String s = "";
			try {
				s = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return s;
		}
	}
}