#include <bits/stdc++.h>
using namespace std;
static inline void canhazfast() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T extgcd(T a, T b, T &x, T &y) {
  T x0 = 1, y0 = 0, x1 = 0, y1 = 1;
  while (b) {
    T q = a / b;
    a %= b;
    swap(a, b);
    x0 -= q * x1;
    swap(x0, x1);
    y0 -= q * y1;
    swap(y0, y1);
  }
  x = x0;
  y = y0;
  return a;
}
static inline int ctz(unsigned x) { return __builtin_ctz(x); }
static inline int ctzll(unsigned long long x) { return __builtin_ctzll(x); }
static inline int clz(unsigned x) { return __builtin_clz(x); }
static inline int clzll(unsigned long long x) { return __builtin_clzll(x); }
static inline int popcnt(unsigned x) { return __builtin_popcount(x); }
static inline int popcntll(unsigned long long x) {
  return __builtin_popcountll(x);
}
static inline int bsr(unsigned x) { return 31 ^ clz(x); }
static inline int bsrll(unsigned long long x) { return 63 ^ clzll(x); }
vector<int> adj[300016];
int x[300016], y[300016], pos[300016];
long long ans[300016];
pair<int, int> p[300016];
int main() {
  canhazfast();
  int n, m, c;
  long long sx = 0, sy = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> x[i] >> y[i];
    p[i] = make_pair(x[i] - y[i], i);
  }
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  sort(p + 1, p + 1 + n);
  for (int i = 1; i <= n; ++i) pos[p[i].second] = i;
  c = 0;
  for (int i = 1; i <= n; ++i) {
    int u = p[i].second;
    for (int v : adj[u]) {
      if (pos[v] < pos[u]) {
        sx -= x[v];
        --c;
      }
    }
    ans[u] += (long long)c * y[u] + sx;
    for (int v : adj[u]) {
      if (pos[v] < pos[u]) {
        sx += x[v];
        ++c;
      }
    }
    sx += x[u];
    ++c;
  }
  c = 0;
  for (int i = n; i > 0; --i) {
    int u = p[i].second;
    for (int v : adj[u]) {
      if (pos[v] > pos[u]) {
        sy -= y[v];
        --c;
      }
    }
    ans[u] += (long long)c * x[u] + sy;
    for (int v : adj[u]) {
      if (pos[v] > pos[u]) {
        sy += y[v];
        ++c;
      }
    }
    sy += y[u];
    ++c;
  }
  for (int i = 1; i <= n; ++i) cout << ans[i] << ' ';
  return 0;
}
