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.
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int maxn = 1e6 + 5;
vector<long long> mprime;
vector<long long> arr, brr;
class BitDicTree {
 public:
  vector<int> vp;
  vector<vector<int>> cp;
  BitDicTree() {
    cp.push_back(vector<int>(2, -1));
    vp.push_back(0);
  }
  void add(int x) {
    int pos = 0;
    for (int i = 31; i >= 0; i--) {
      int c = (x >> i) & 1;
      if (cp[pos][c] == -1) {
        cp.push_back(vector<int>(2, -1));
        vp.push_back(0);
        cp[pos][c] = vp.size() - 1;
      }
      vp[cp[pos][c]] += 1;
      pos = cp[pos][c];
    }
  }
  void remove(int x) {
    int pos = 0;
    for (int i = 31; i >= 0; i--) {
      int c = (x >> i) & 1;
      vp[cp[pos][c]] -= 1;
      pos = cp[pos][c];
    }
  }
  int query(int x) {
    int pos = 0;
    int ans = 0;
    for (int i = 31; i >= 0; i--) {
      int c = ((x >> i) & 1);
      if (cp[pos][1 - c] != -1 && vp[cp[pos][1 - c]] > 0) {
        ans += (1 << i);
        pos = cp[pos][1 - c];
      } else
        pos = cp[pos][c];
    }
    return ans;
  }
};
class UF {
 public:
  vector<long long> tree;
  int nodes;
  UF(int n) {
    nodes = n;
    tree = vector<long long>(n);
    iota(begin(tree), end(tree), 0);
  }
  int find(int st) {
    if (tree[st] != st) tree[st] = find(tree[st]);
    return tree[st];
  }
  bool connect(int a, int b) {
    int ua = find(a);
    int ub = find(b);
    if (ua != ub) {
      tree[ua] = ub;
      nodes -= 1;
    }
    return ua != ub;
  }
  int query() { return nodes; }
};
class Math {
 public:
  vector<long long> fac, inv;
  int MOD;
  Math(int n, int mod) {
    MOD = mod;
    fac = vector<long long>(n);
    inv = vector<long long>(n);
    fac[0] = 1;
    for (int i = 1; i < n; i++) {
      fac[i] = fac[i - 1] * i % MOD;
    }
    inv[n - 1] = QPow(fac[n - 1], MOD - 2);
    for (int i = n - 2; i >= 0; i--) {
      inv[i] = inv[i + 1] * (i + 1) % MOD;
    }
  }
  long long comb(int n, int m) {
    return ((fac[n] * inv[m]) % MOD * inv[n - m]) % MOD;
  }
  long long arrang(int n, int m) { return fac[n] * inv[n - m] % MOD; }
  long long QPow(long long x, long long n) {
    long long ret = 1;
    long long tmp = x % MOD;
    while (n) {
      if (n & 1) {
        ret = (ret * tmp) % MOD;
      }
      tmp = tmp * tmp % MOD;
      n >>= 1;
    }
    return ret;
  }
};
class Tree {
 public:
  int n;
  vector<vector<int>> g;
  vector<int> depth, fa, tin, tout;
  int T = 0;
  Tree(int n) {
    g = vector<vector<int>>(n);
    depth = vector<int>(n);
    fa = vector<int>(n, -1);
    tin = vector<int>(n);
    tout = vector<int>(n);
  }
  void addEdge(int a, int b) {
    g[a].push_back(b);
    g[b].push_back(a);
  }
  void dfs(int cur, int dep, int fap) {
    depth[cur] = dep;
    tin[cur] = T++;
    for (int nc : g[cur]) {
      if (nc != fap) {
        fa[nc] = cur;
        depth[nc] = dep + 1;
        dfs(nc, dep + 1, cur);
      }
    }
    tout[cur] = T++;
  }
  bool inPath(int pchild, int pfa) {
    return tin[pfa] <= tin[pchild] && tout[pfa] >= tout[pchild];
  }
};
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b) {
    x = 1;
    y = 0;
    return a;
  } else {
    long long tx, ty;
    long long d = exgcd(b, a % b, tx, ty);
    x = ty;
    y = tx - (a / b) * ty;
    return d;
  }
}
unsigned euler(unsigned x) {
  unsigned i, res = x;
  for (i = 2; i < (int)sqrt(x * 1.0) + 1; i++) {
    if (!(x % i)) {
      res = res / i * (i - 1);
      while (!(x % i)) {
        x /= i;
      }
    }
  }
  if (x > 1) {
    res = res / x * (x - 1);
  }
  return res;
}
void mprime_init() {
  mprime = vector<long long>(maxn, -1);
  for (int i = 2; i < maxn; i++) {
    if (mprime[i] == -1) {
      mprime[i] = i;
      for (int j = 2 * i; j < maxn; j += i) {
        if (mprime[j] == -1) mprime[j] = i;
      }
    }
  }
}
int n, m;
void solve() {
  int n, k;
  cin >> n >> k;
  vector<pair<int, int>> vp;
  vector<int> ans(n, 0);
  arr = vector<long long>(n);
  for (int i = 0; i < n; i++) {
    int nt;
    cin >> nt;
    vp.push_back({nt, i});
    arr[i] = nt;
  }
  sort(begin(vp), end(vp));
  for (int i = 1; i < n; i++) {
    if (vp[i].first == vp[i - 1].first) {
      ans[vp[i].second] = ans[vp[i - 1].second];
    } else {
      ans[vp[i].second] = i;
    }
  }
  while (k--) {
    int a, b;
    cin >> a >> b;
    a -= 1;
    b -= 1;
    if (arr[a] > arr[b]) ans[a]--;
    if (arr[b] > arr[a]) ans[b]--;
  }
  copy(begin(ans), end(ans), ostream_iterator<int>(cout, " "));
  cout << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  solve();
  return 0;
}
