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.
/**
 * Created by chiragchandnani on 5/15/18.
 * DA-IICT (B.tech 3rd year)
 */

import java.io.*;
import java.util.*;


public class Q6 {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
      
      
      /*
      int n      = sc.nextInt();        // read input as integer
      long k     = sc.nextLong();       // read input as long
      double d   = sc.nextDouble();     // read input as double
      String str = sc.next();           // read input as String
      String s   = sc.nextLine();       // read whole line as String

      int result = 3*n;
      out.println(result);                    // print via PrintWriter
      */
        //The Code Starts here
        int noOfProgrammers=sc.nextInt();
        int noOfQuarrels=sc.nextInt();
        Skill skillOfProgrammer[]=new Skill[noOfProgrammers];
        HashMap<Skill,HashSet<Skill>> quarrelMap=new HashMap<>();
        for(int i=0;i<noOfProgrammers;i++)
        {
            skillOfProgrammer[i]=new Skill(sc.nextInt(),i);
            quarrelMap.put(skillOfProgrammer[i],new HashSet<>());
        }
        HashMap<Integer,Integer> skillMap=new HashMap<>();


        for(int i=0;i<noOfQuarrels;i++)
        {
            int p1=sc.nextInt()-1;
            int p2=sc.nextInt()-1;
            quarrelMap.get(skillOfProgrammer[p1]).add(skillOfProgrammer[p2]);
            quarrelMap.get(skillOfProgrammer[p2]).add(skillOfProgrammer[p1]);
        }
        Arrays.sort(skillOfProgrammer);
//        debug(skillOfProgrammer);
//        debug(quarrelMap);
        TreeMap<Integer,Integer> finalAnswer=new TreeMap<>();

        for(int i=0;i<skillOfProgrammer.length;i++)
        {
            int ans=i;
            ans-=skillMap.getOrDefault(skillOfProgrammer[i].skill,0);
            for(Skill programmer:quarrelMap.get(skillOfProgrammer[i]))
            {
                if(programmer.skill<skillOfProgrammer[i].skill)
                    ans--;
            }
            skillMap.put(skillOfProgrammer[i].skill,skillMap.getOrDefault(skillOfProgrammer[i].skill,0)+1);
            finalAnswer.put(skillOfProgrammer[i].index,ans);
        }
        for(int value:finalAnswer.values())
            out.print(value + " ");


        //The Code ends here
        out.close();
    }


    static class Skill implements Comparable<Skill>{
        int skill;
        int index;


        Skill(int skill,int index) {
            this.skill = skill;
            this.index = index;
        }

        public int compareTo(Skill o)
        {
            return Integer.compare(this.skill,o.skill);
        }

        public String toString()
        {
            return "Skill : " + this.skill + " Index : " + this.index;
        }

    }


    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;

    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

        char nextCharacter() {
            return next().charAt(0);
        }

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

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

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public int[][] nextInt2DArray(int m, int n) {
            int[][] arr = new int[m][n];
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++)
                    arr[i][j] = nextInt();
            }
            return arr;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    }

    public static void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }

    public static class Pair implements Comparable<Pair> {
        long u;
        long v;

        public Pair(long u, long v) {
            this.u = u;
            this.v = v;
        }


        public int hashCode() {
            int hu = (int) (u ^ (u >>> 32));
            int hv = (int) (v ^ (v >>> 32));
            return 31 * hu + hv;
        }

        public boolean equals(Object o) {
            Pair other = (Pair) o;
            return u == other.u && v == other.v;
        }

        public int compareTo(Pair other) {
            return Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);
        }

        public String toString() {
            return "[u=" + u + ", v=" + v + "]";
        }
    }
    //--------------------------------------------------------


    // Different other methods

    public static long pow(long n, long p, long mod) {
        if (p == 0)
            return 1;
        if (p == 1)
            return n % mod;
        if (p % 2 == 0) {
            long temp = pow(n, p / 2, mod);
            return (temp * temp) % mod;
        } else {
            long temp = pow(n, p / 2, mod);
            temp = (temp * temp) % mod;
            return (temp * n) % mod;

        }
    }

    public static long pow(long n, long p) {
        if (p == 0)
            return 1;
        if (p == 1)
            return n;
        if (p % 2 == 0) {
            long temp = pow(n, p / 2);
            return (temp * temp);
        } else {
            long temp = pow(n, p / 2);
            temp = (temp * temp);
            return (temp * n);

        }
    }

    public static long gcd(long x, long y) {
        if (x == 0)
            return y;
        else
            return gcd(y % x, x);
    }

    static long modInverse(long a, long m) {
        long m0 = m, t, q;
        long x0 = 0, x1 = 1;

        if (m == 1)
            return 0;

        while (a > 1) {
            // q is quotient
            q = a / m;

            t = m;

            // m is remainder now, process
            // same as Euclid's algo
            m = a % m;
            a = t;

            t = x0;

            x0 = x1 - q * x0;

            x1 = t;
        }

        // Make x1 positive
        if (x1 < 0)
            x1 += m0;

        return x1;
    }

    public static boolean isPrime(int n) {
        if (n <= 1)
            return false;
        if (n <= 3)
            return true;

        if (n % 2 == 0 || n % 3 == 0)
            return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }

    public static class DisjointSet {
        HashMap<Integer, Node> map = new HashMap<Integer, Node>();

        class Node {
            int data;
            int rank;
            Node parent;

            Node(int data) {
                this.data = data;
                this.rank = 0;
                this.parent = this;
            }
        }

        void makeSet(int data) {
            map.put(data, new Node(data));
        }

        Node findSet(int data) {
            return findSet(map.get(data));
        }

        boolean isConnected(int d1, int d2) {
            return findSet(d1) == findSet(d2);
        }

        Node findSet(Node node) {
            Node parent = node.parent;
            if (parent == node)
                return parent;
            node.parent = findSet(node.parent);
            return node.parent;
        }

        void union(int data1, int data2) {
            Node d1 = map.get(data1);
            Node d2 = map.get(data2);

            Node p1 = findSet(d1);
            Node p2 = findSet(d2);

            if (p1.data == p2.data)
                return;

            if (p1.rank >= p2.rank) {
                p1.rank = (p1.rank == p2.rank) ? p1.rank + 1 : p1.rank;
                p2.parent = p1;
            } else {
                p1.parent = p2;
            }
        }

    }
}
