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.sql.Array;
import java.util.*;
import java.io.*;

public class Main {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        TaskF.solve(in, out);
        out.close();
    }

    static class TaskA {
        static public void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            HashSet<Integer> hi = new HashSet<>(n);
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = in.nextInt();
            ArrayList<Integer> ans = new ArrayList<>();
            boolean[] was = new boolean[n];
            for (int i = n - 1; i >= 0; i--) {
                if (!hi.contains(a[i])) {
                    was[i] = true;
                    hi.add(a[i]);
                }
            }
            for (int i = 0; i < n; i++)
                if (was[i]) ans.add(a[i]);
            out.println(ans.size());
            for (int i : ans)
                out.print(i + " ");
        }
    }

    static class TaskB {
        static public void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            String s = in.nextString();
            for (int i = 0; i < s.length() - 2; i++) {
                if (s.charAt(i) == 'x' && s.charAt(i + 1) == 'x' && s.charAt(i + 2) == 'x') {
                    s = s.substring(0, i) + s.substring(i + 1);
                    i--;
                }
            }
            out.println(n - s.length());
        }
    }

    static class TaskC {
        static public void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = in.nextLong();
            long[] s = new long[n];
            for (int i = 0; i < n; i++) {
                s[i] += a[i];
                if (i > 0) s[i] += s[i - 1];
            }
            for (int q = 0; q < m; q++) {
                long t = in.nextLong();
                int l = -1, r = n;
                while (l < r - 1) {
                    int mid = (l + r) / 2;
                    if (s[mid] < t) l = mid;
                    else r = mid;
                }
                out.print((r + 1) + " " + (t - (r > 0 ? s[r - 1] : 0)));
                out.println();
            }
        }
    }

    static class TaskD {
        static public void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = in.nextInt();
            if (n == 1 || n == 2) {
                out.println(0);
                return;
            }
            int d = a[1] - a[0];
            int ans = n + 1;
            for (int i = d - 2; i <= d + 2; i++) {
                for (int q = a[0] - 1; q <= a[0] + 1; q++) {
                    int[] aa = new int[n];
                    aa[0] = q;
                    for (int j = 1; j < n; j++)
                        aa[j] = aa[j - 1] + i;
                    boolean can = true;
                    int newans = 0;
                    for (int j = 0; j < n; j++) {
                        int delta = Math.abs(aa[j] - a[j]);
                        if (delta > 1) {
                            can = false;
                            break;
                        }
                        else newans += delta;
                    }
                    if (can) ans = Math.min(ans, newans);
                }
            }
            if (ans == n + 1) out.println(-1);
            else out.println(ans);
        }
    }

    static class TaskE {
        static public void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int w = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = in.nextInt();
            int maxd = 0, mind = 0;
            for (int i = 0, cur = 0; i < n; i++) {
                cur += a[i];
                maxd = Math.max(maxd, cur);
                mind = Math.min(mind, cur);
            }
            int r = w - maxd;
            int l = -mind;
            if (l > r) out.println(0);
            else out.println(r - l + 1);
        }
    }

    static class TaskF {
        static public void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] r = new int[n];
            for (int i = 0; i < n; i++)
                r[i] = in.nextInt();
            int[] cnt = new int[n];
            for (int i = 0; i < k; i++) {
                int x = in.nextInt() - 1;
                int y = in.nextInt() - 1;
                if (r[x] > r[y]) cnt[x]++;
                else if (r[x] < r[y]) cnt[y]++;
            }
            ArrayList<Pair<Integer, Integer>> ap = new ArrayList<>(n);
            for (int i = 0; i < n; i++)
                ap.add(new Pair<Integer, Integer>(r[i], i));
            Collections.sort(ap);
            int[] ans = new int[n];
            for (int i = 0, eq = 0; i < n; i++) {
                int cur = ap.get(i).second;
                if (i > 0 && ap.get(i - 1).first.equals(ap.get(i).first)) eq++;
                else eq = 0;
                ans[cur] = i - eq - cnt[cur];
            }
            for (int i = 0; i < n; i++)
                out.print(ans[i] + " ");
        }
    }

    public static class Pair<T extends Comparable<T>, Y extends Comparable<Y>> implements Comparable<Pair<T, Y>> {
        public T first;
        public Y second;
        Pair() {
            first = null;
            second = null;
        }
        Pair(T first, Y second) {
            this.first = first;
            this.second = second;
        }
        public int compareTo(Pair<T, Y> p) {
            int a = first.compareTo(p.first);
            if (a != 0) return a;
            a = second.compareTo(p.second);
            return a;
        }
    }

    public static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String nextString() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try { tokenizer = new StringTokenizer(reader.readLine()); }
                catch (IOException e) { throw new RuntimeException(e); }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

        public long nextLong() {
            return Long.parseLong(nextString());
        }

        public double nextDouble() {
            return Double.parseDouble(nextString());
        }
    }
}
