#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 15;
int n, m;
int a[MAXN], b[MAXN], id[MAXN];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cerr << "HELLO WORLD\n";
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  memcpy(b, a, sizeof(a));
  sort(b, b + n);
  for (int i = 0; i < n; i++) id[i] = lower_bound(b, b + n, a[i]) - b;
  while (m--) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    if (a[x] != a[y]) {
      if (a[x] > a[y])
        id[x]--;
      else
        id[y]--;
    }
  }
  for (int i = 0; i < n; i++) cout << id[i] << ' ';
  return cout << '\n', false;
}
