#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template <class T>
ostream& prnt(ostream& out, T v) {
  out << v.size() << '\n';
  for (auto e : v) out << e << ' ';
  return out;
}
template <class T>
ostream& operator<<(ostream& out, vector<T> v) {
  return prnt(out, v);
}
template <class T>
ostream& operator<<(ostream& out, set<T> v) {
  return prnt(out, v);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, map<T1, T2> v) {
  return prnt(out, v);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> p) {
  return out << '(' << p.first << ' ' << p.second << ')';
}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << H;
  debug_out(T...);
}
const long long N = 300100;
long long n, col[N], x[N], y[N], m, r, s;
long long ans[N], nra, nrb, suma, sumb;
vector<pair<long long, long long> > h;
vector<long long> v[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
    sumb += y[i];
    nrb++;
    h.push_back({x[i] - y[i], i});
  }
  for (long long i = 1; i <= m; i++) {
    cin >> r >> s;
    v[s].push_back(r);
    v[r].push_back(s);
  }
  sort(h.begin(), h.end());
  for (auto p : h) {
    sumb -= y[p.second];
    nrb--;
    ans[p.second] +=
        1LL * sumb + nrb * x[p.second] + 1LL * nra * y[p.second] + 1LL * suma;
    for (auto i : v[p.second]) {
      if (x[i] - y[i] < p.first)
        ans[p.second] -= x[i] + y[p.second];
      else
        ans[p.second] -= x[p.second] + y[i];
    }
    nra++;
    suma += x[p.second];
  }
  for (long long i = 1; i <= n; i++) cout << ans[i] << ' ';
}
