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.

//..............Learning.........//

import java.util.*;
import java.io.*;
import java.lang.*;
public class B {

static FastReader  sc  = new FastReader();
static PrintWriter out = new PrintWriter(System.out);

public static void main(String[] args) throws Exception {
// try {
//	sieve();
//Arrays.fill(dp, -1);
  int t = 1;
  while (t-- > 0)
  B.go();
  out.flush();
// } catch (Exception e) {
//    return;}
}
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Code Starts <<<<<<<<<<<<<<<<<<<<<<<<<<<<< //
static int mod=998244353;
static HashSet<Integer> set=new HashSet<>();
static void go() {
int n=sc.nextInt();
int k=sc.nextInt();
int a[]=new int[n];
two b[]=new two[n];
HashMap<Integer,Integer> map=new HashMap<>();
for(int i=0;i<n;i++) {
	a[i]=sc.nextInt();
	b[i]=new two(a[i],i);
	map.put(a[i],map.getOrDefault(a[i], 0)+1);
}
Arrays.sort(b);
int ans[]=new int[n];

ans[b[0].ind]=0;
for(int i=1;i<n;i++) {
	if(b[i].val>b[i-1].val) {
		ans[b[i].ind]=ans[b[i-1].ind]+map.get(b[i-1].val);
	}else {
		ans[b[i].ind]=ans[b[i-1].ind];
	}
}
ArrayList<ArrayList<Integer>> aa=new ArrayList<>();
for(int i=0;i<n;i++) {
	aa.add(new ArrayList<>());
}
for(int i=0;i<k;i++) {
	int x=sc.nextInt()-1;
	int y=sc.nextInt()-1;
	if(a[x]>a[y]) {
	aa.get(x).add(y);
	}
	if(a[y]>a[x]) {
	aa.get(y).add(x);
	}
}
for(int i=0;i<n;i++) {
	out.print(ans[i]-aa.get(i).size()+" ");
}
//out.println(Arrays.toString(ans));
}


// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Code Ends <<<<<<<<<<<<<<<<<<<<<<<<<<<<< //


static long gcd(long a,long b){
    if(b==0){
        return a;
    }return gcd(b,a%b);
}
static long fact[];
static long invfact[];
static long ncr(int n,int k) {
	if(k<0||k>n) {
		return 0;
	}
	long x=fact[n]%mod;
	long y=invfact[k]%mod;
	long yy=invfact[n-k]%mod;
	long ans=(x*y)%mod;
	ans=(ans*yy)%mod;
	return ans;
}
static int prime[]=new int[1000006];
static void sieve() {
	Arrays.fill(prime, 1);
	prime[0]=0;
	prime[1]=0;
	for(int i=2;i*i<=1000005;i++) {
		if(prime[i]==1)
		for(int j=i*i;j<=1000005;j+=i) {
			prime[j]=0;
		}
	}
	for(int i=1;i<1000005;i++) {prime[i]=prime[i]+prime[i-1];}
}
static void sort(long [] a) {
  ArrayList<Long> aa = new ArrayList<>();
  for (long  i : a) {
    aa.add(i);
  }Collections.sort(aa);  for (int i = 0; i < a.length; i++)
    a[i] = aa.get(i);	  }
static void sort(int [] a) {
  ArrayList<Integer> aa = new ArrayList<>();
  for (int  i : a) {
    aa.add(i);
  } Collections.sort(aa); for (int i = 0; i < a.length; i++)
    a[i] = aa.get(i); }
static long pow(long x, long y) {
  long res = 1l;
  while (y != 0) {
    if (y % 2 == 1) {
      res = (x%mod * res%mod)%mod; } y /= 2; x = (x%mod * x%mod)%mod;
  } return res%mod;  }

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Fast IO <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //

static class FastReader {
  BufferedReader  br;
  StringTokenizer st;public FastReader() {
    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());
  } String nextLine() {
    String str = "";
    try {
      str = br.readLine();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return str;
  }}
}
class two implements Comparable<two>{
	int val;int ind;
	two(int val,int ind){
		this.val=val;
		this.ind=ind;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ind;
		result = prime * result + val;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		two other = (two) obj;
		if (val != other.val)
			return false;
		return true;
	}
	@Override
	public int compareTo(two o) {
		if(this.val==o.val) {
			return Integer.compare(this.ind, o.ind);
		}
		return -Integer.compare(o.val, this.val);
	}

}


/*
 * imp log method using math function is somewhat inaccurate to check power of
 * two
 *
 */