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.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Random;
import java.util.StringTokenizer;


public class Main {

	public static void main(String[] args) throws IOException, InterruptedException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskC {
		static boolean visited[]  ;
		static boolean found = false; 

		static int steps = 0 ;
		static int n ; 
		static boolean memo [][] ; 
		static int dp[][] ; 
		static char matrix[][] ;
		static ArrayList<Integer> p  ;
		public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException, InterruptedException {

			int n =in.nextInt() ; 
			int k = in.nextInt() ; 

			int r[]=new int[n] ;
			pair arr[] =  new pair[n] ; 

			for (int i = 0; i < r.length; i++)
			{
				r[i] = in.nextInt() ; 
				arr[i]= new pair(i , r[i] , 0) ;
			}






			for (int i = 0; i < k; i++)
			{
				int	x= in.nextInt()-1 ; 
				int	y= in.nextInt()-1 ; 


				if(r[y]<r[x])
					arr[x].qless++ ; 

				if(r[x]<r[y])
					arr[y].qless++ ; 
			}

			Arrays.sort(arr);
			HashMap<Integer , Integer> firstI = new HashMap<Integer, Integer>() ; 
			for (int i = 0; i < arr.length; i++)
			{
				if (!firstI.containsKey(arr[i].r))
					firstI.put(arr[i].r, i);
			}


			pair2[] bb = new pair2[n] ; 
			bb[0]= new pair2(arr[0].i , 0) ;

			for (int i =1 ; i < arr.length; i++)
			{
				int result = i ; 
				result -=(arr[i].qless) ;
				int x= (firstI.get(arr[i].r)) ;
				result -= (i-x) ; 

				bb[i]= new pair2(arr[i].i , result) ;
			}

			Arrays.sort(bb) ; 
			for (int i = 0; i < bb.length; i++)
			{
				System.out.print(bb[i].result+" ");
			}






		}





		public static int cnt1(int mat[][])  //how many swaps to be a 1 matrix
		{
			int m = mat.length ; 
			int c=0 ; 
			for (int i = 0; i < mat.length; i++)
			{
				for (int j = 0; j < mat.length; j++)
				{
					int x =  (i*m) +j ;
					if(x%2==0 && mat[i][j]==0)
						c++; 
					if(x%2!=0 && mat[i][j]==1)
						c++; 

				}
			}
			return c;
		}
		public static int cnt0(int mat[][])
		{
			int m = mat.length ; 
			int c=0 ; 
			for (int i = 0; i < mat.length; i++)
			{
				for (int j = 0; j < mat.length; j++)
				{
					int x =  (i*m) +j ; 
					if(x%2!=0 && mat[i][j]==0)
						c++; 
					if(x%2==0 && mat[i][j]==1)
						c++; 

				}
			}
			return c;
		}

		public static boolean canFit2(int x1, int y1 , int x2 , int y2 , int x3 , int y3){
			if(x1==x2)
				if(x1==x3)
					return true ; 
				else
					return false ;
			else
				if(x1==x3)
					return false ; 
				else
				{
					long a = 1l*(y2-y1)*(x3-x2) ; 
					long b = 1l*(y3-y2)*(x2-x1) ; 

					if(a==b)
						return true;
					else 
						return false ;

				}

		}
		public static void shuffle(int c[]){
			if(c.length==1)
				return ; 
			for (int i = 0; i < c.length; i++)
			{
				Random rand = new Random();

				int  n = rand.nextInt(c.length-1) + 0;

				int temp = c[i] ; 
				c[i] = c[n] ; 
				c[n] = temp ;
			}
		}
		public static int binary(long[]arr, int l, int r, long x)   /// begin by 0 and n-1
		{
			if (r>=l)
			{
				int mid = l + (r - l)/2;
				if (arr[mid]== x)
					return mid;
				if (arr[mid]> x)
					return binary(arr, l, mid-1, x);
				return binary(arr, mid+1, r, x);
			}
			return -1;
		}

		/// searching for the index of first elment greater than x
		public static int binary1(long[]arr , long x) {
			int low = 0, high = arr.length; // numElems is the size of the array i.e arr.size() 
			while (low != high) {
				int mid = (low + high) / 2; // Or a fancy way to avoid int overflow
				if (arr[mid] <= x) {
					/* This index, and everything below it, must not be the first element
					 * greater than what we're looking for because this element is no greater
					 * than the element.
					 */
					low = mid + 1;
				}
				else {
					/* This element is at least as large as the element, so anything after it can't
					 * be the first element that's at least as large.
					 */
					high = mid;
				}
			}
			return low ; // return high ; 
		}


		private static boolean triangle(int a, int b , int c){
			if(a+b>c && a+c>b && b+c>a)
				return true ; 
			else 
				return false ;
		}
		private static boolean segment(int a, int b , int c){
			if(a+b==c || a+c==b && b+c==a)
				return true ; 
			else 
				return false ;
		}
		private static int gcdThing(long a, long b) {
			BigInteger b1 = BigInteger.valueOf(a);
			BigInteger b2 = BigInteger.valueOf(b);
			BigInteger gcd = b1.gcd(b2);
			return gcd.intValue();
		}

		public static boolean is(int i){
			if(Math.log(i)/ Math.log(2) ==(int) (Math.log(i)/ Math.log(2)))
				return true ; 
			if(Math.log(i)/ Math.log(3) ==(int) (Math.log(i)/ Math.log(3)) )
				return true ; 
			if(Math.log(i)/ Math.log(6) ==(int) (Math.log(i)/ Math.log(6)) )
				return true ; 

			return false;

		}
		public static boolean contains(int b[] , int x)
		{
			for (int i = 0; i < b.length; i++)
			{
				if(b[i]==x)
					return true ;
			}
			return false ;
		}
		public static int binary(long []arr , long target , int low , long shift) {
			int high = arr.length; 
			while (low != high) {
				int mid = (low + high) / 2; 
				if (arr[mid]-shift <= target) {
					low = mid + 1;
				}
				else {
					high = mid;
				}
			}
			return low ; // return high ; 
		}
		public static boolean isLetter(char x){
			if(x+0 <=122 && x+0 >=97 )
				return true ;
			else if (x+0 <=90 && x+0 >=65 )
				return true ; 
			else return false; 
		}
		public static long getPrimes(long x ){
			if(x==2 || x==3 || x==1)
				return 2 ;
			if(isPrime(x))
				return 5 ;
			for (int i = 2; i*i<=x; i++)
			{
				if(x%i==0 && isPrime(i))
					return getPrimes(x/i) ;
			}
			return -1;
		}
		public static String solve(String x){

			int n = x.length() ; 
			String y = "" ;
			for (int i = 0; i < n-2; i+=2)
			{
				if(ifPalindrome(x.substring(i, i+2)))
					y+= x.substring(i, i+2) ;
				else 
					break ;
			}
			return y+ solve1(x.substring(y.length(),x.length())) ;

		}
		public static String solve1(String x){
			String y = x.substring(0 , x.length()/2) ; 
			return "" ;

		}
		public static String reverse(String x){
			String y ="" ;
			for (int i = 0; i < x.length(); i++)
			{
				y  = x.charAt(i) + y ;
			}
			return y ;
		}

		public static boolean ifPalindrome(String x){
			int numbers[] = new int[10] ; 
			for (int i = 0; i < x.length(); i++)
			{
				int z = Integer.parseInt(x.charAt(i)+"") ; 
				numbers[z] ++ ;
			}
			for (int i = 0; i < numbers.length; i++)
			{
				if(numbers[i]%2!=0)
					return false; 
			}
			return true ;	
		}

		public static int get(int n){
			return n*(n+1)/2 ; 
		}
		//		public static long getSmallestDivisor( long y){
		//			if(isPrime(y))
		//				return -1;
		//
		//			for (long i = 2; i*i <= y; i++)
		//			{
		//				if(y%i ==0)
		//				{
		//					return i;
		//				}
		//			}
		//			return -1;
		//		}
		//		public static void lis(pair []a , int n){
		//			int lis[] = new int[n] ; 
		//			Arrays.fill(lis,1) ; 
		//
		//			for(int i=1;i<n;i++)
		//				for(int j=0 ; j<i; j++)
		//					if (a[i].y>a[j].y &&  lis[i] < lis[j]+1)   
		//						lis[i] = lis[j] + 1;           
		//
		//			int max = lis[0];
		//
		//			for(int i=1; i<n ; i++)
		//				if (max < lis[i])
		//					max = lis[i] ;
		//			System.out.println(max);
		//
		//			ArrayList<Integer> s = new ArrayList<Integer>() ;
		//			for (int i = n-1; i >=0; i--)
		//			{
		//				if(lis[i]==max)
		//				{
		//					s.add(a[i].z);
		//					max --; 
		//				}
		//			}
		//
		//			for (int i = s.size()-1 ; i>=0 ;  i--)
		//			{
		//				System.out.print(s.get(i)+" ");
		//			}
		//
		//			return  ; 
		//		}
		public static int calcDepth(Vertix node){
			if(node.depth>0) return node.depth; 
			// meaning it has been updated before;
			if(node.parent != null)
				return 1+ calcDepth(node.parent);
			else
				return -1;
		}

		public static boolean isPrime (long num){
			if (num < 2) return false;
			if (num == 2) return true;
			if (num % 2 == 0) return false;
			for (int i = 3; i * i <= num; i += 2)
				if (num % i == 0) return false;
			return true;
		}


		public static int[] getDiv(int n)
		{
			int result[] = new int[7] ; 
			ArrayList<Integer>  f = new ArrayList<Integer>() ; 

			while (n%2==0)
			{
				if(!f.contains(2))f.add(2) ;
				n /= 2;
			}

			// n must be odd at this point.  So we can
			// skip one element (Note i = i +2)
			for (int i = 3; i <= Math.sqrt(n); i+= 2)
			{
				// While i divides n, print i and divide n
				while (n%i == 0)
				{
					if(!f.contains(i))f.add(i);
					n /= i;
				}
			}

			// This condition is to handle the case whien
			// n is a prime number greater than 2
			if (n > 2)
				if(!f.contains(n))f.add(n);

			for (int i = 0, j=0; i < f.size(); i++)
			{
				result[j++]=f.get(i);
			}
			return result ;



		}

		//		public static boolean dfs(Vertix v , int target){
		//			try{
		//				visited[v.i]= true ;
		//			} catch (NullPointerException e)
		//			{
		//				System.out.println(v.i);
		//			}
		//			if(v.i == target)
		//
		//				return true ;
		//			for (int i =0 ; i< v.neighbours.size() ; i++)
		//			{ 
		//
		//				Vertix child = v.neighbours.get(i) ;
		//				if(child.i == target){
		//					found = true  ; 
		//				}
		//				if(visited[child.i]==false){
		//					found |= dfs(child, target) ;
		//				}
		//			}
		//			return found; 
		//		}






	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

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

		public String next() {
			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(next());
		}

	}
	public static class Vertix{
		long i ; 
		int depth ;
		ArrayList<Vertix> neighbours ; 
		Vertix parent ; 
		Vertix child ; 


		public Vertix(long i){
			this.i = i ;
			this.neighbours = new ArrayList<Vertix> () ;
			this.parent = null ;
			depth =-1;
			this.child = null ;
		}
	}

	public static class pair implements Comparable<pair>{
		int i ;  
		int r ; 
		int qless  ; /// is his quarrel has skill less than him





		public pair(int x, int y ,int z){
			this.i=x ; 
			this.r=y ;
			this .qless =z ;


		}

		@Override
		public int compareTo(pair p) {
			if(this.r > p.r)
				return 1 ; 
			else if(this.r == p.r) return 0 ;
			else return -1 ;


		}


	}

	public static class pair2 implements Comparable<pair2>{
		int i ; 
		int result ; 

		public pair2(int i , int result){
			this.i =i ;
			this.result = result ; 
		}

		@Override
		public int compareTo(pair2 p) {
			if(this.i > p.i)
				return 1 ; 
			else if (this.i == p.i) return 0 ;
			else 
				return -1 ;
		}


	}


}