#include <bits/stdc++.h>
using namespace std;
const int N = 300000 + 10;
int n, m, x[N], y[N];
pair<long long, long long> c[N];
pair<pair<long long, long long>, pair<long long, long long> > p[N];
vector<int> g[N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", x + i, y + i);
    p[i] = {{x[i] - y[i], i}, {x[i], y[i]}};
  }
  sort(p + 1, p + n + 1);
  for (int i = 1; i <= n; ++i) {
    c[i] = {p[i].second.first, p[i].second.second};
    c[i].first += c[i - 1].first;
    c[i].second += c[i - 1].second;
  }
  for (int i = 0, u, v; i < m; ++i) {
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    swap(u, v);
    g[u].push_back(v);
  }
  long long res1 = 0;
  vector<long long> ress(n + 1);
  for (int i = 1; i <= n; ++i) {
    res1 += c[i - 1].first + (i - 1) * p[i].second.second + c[n].second -
            c[i].second + (n - (i - 1) - 1) * p[i].second.first;
    int u = p[i].first.second;
    for (auto v : g[u]) res1 -= min(x[u] + y[v], x[v] + y[u]);
    ress[p[i].first.second] = res1;
    res1 = 0;
  }
  for (int i = 1; i <= n; ++i) printf("%lld ", ress[i]);
  puts("");
  return 0;
}
