#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
struct tnode {
  T x, u, v;
  int s;
  ll su;
  ll sv;
  int y = rand();
  tnode *l = 0, *r = 0;
  tnode(int w, int z) {
    x = w - z;
    s = 1;
    su = u = w;
    sv = v = z;
  }
  ~tnode() {
    delete l;
    delete r;
  }
  tnode *upd() {
    s = 1;
    su = u;
    sv = v;
    if (l) {
      s += l->s;
      su += l->su;
      sv += l->sv;
    }
    if (r) {
      s += r->s;
      su += r->su;
      sv += r->sv;
    }
    return this;
  }
};
template <class T, class F = less<T>>
struct treap {
  using node = tnode<T>;
  F f;
  node *L = 0;
  node *R = 0;
  node *root = 0;
  ~treap() { delete root; }
  node *join(node *l, node *r) {
    if (not l) return r;
    if (not r) return l;
    if (l->y > r->y)
      return l->r = join(l->r, r), l->upd();
    else
      return r->l = join(l, r->l), r->upd();
  }
  void split(node *p, T const &x, node *&l, node *&r) {
    if (not p)
      l = r = 0;
    else if (f(p->x, x))
      l = p, split(l->r, x, l->r, r), p->upd();
    else
      r = p, split(r->l, x, l, r->l), p->upd();
  }
  node *join(node *a, node *b, node *c) { return join(a, join(b, c)); }
  void insert(T const &x, T const &y) {
    split(root, x - y, L, R);
    root = join(L, new node(x, y), R);
  }
  ll query(T const &x, T const &y) {
    split(root, x - y, L, R);
    ll ans = 0;
    if (L) ans += L->su + 1ll * y * L->s;
    if (R) ans += R->sv + 1ll * x * R->s;
    root = join(L, R);
    return ans;
  }
};
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  treap<int> t;
  vector<pair<int, int>> a(n);
  for (auto &[x, y] : a) {
    cin >> x >> y;
    t.insert(x, y);
  }
  vector<vector<int>> g(n);
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    g[u].emplace_back(v);
    g[v].emplace_back(u);
  }
  for (int i = 0; i < n; ++i) {
    treap<int> rem;
    auto x = a[i].first;
    auto y = a[i].second;
    for (auto o : g[i]) rem.insert(a[o].first, a[o].second);
    ll ans = t.query(x, y) - rem.query(x, y) - x - y;
    cout << ans << ' ';
  }
}
