#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
  }
  vector<vector<int> > f(n);
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    f[x].push_back(y);
    f[y].push_back(x);
  }
  vector<pair<int, int> > q;
  for (int i = 0; i < n; ++i) {
    q.push_back({x[i] - y[i], i});
  }
  sort((q).begin(), (q).end());
  vector<long long> ans(n);
  set<int> ids;
  long long sum = 0;
  for (int i = q.size() - 1; i >= 0; --i) {
    long long temp_sum = sum;
    long long temp_num = ids.size();
    for (int j : f[q[i].second]) {
      if (ids.find(j) != ids.end()) {
        temp_sum -= y[j];
        --temp_num;
      }
    }
    ids.insert(q[i].second);
    sum += y[q[i].second];
    ans[q[i].second] += temp_num * x[q[i].second] + temp_sum;
  }
  ids.clear();
  sum = 0;
  for (int i = 0; i < q.size(); ++i) {
    long long temp_sum = sum;
    long long temp_num = ids.size();
    for (int j : f[q[i].second]) {
      if (ids.find(j) != ids.end()) {
        temp_sum -= x[j];
        --temp_num;
      }
    }
    ids.insert(q[i].second);
    sum += x[q[i].second];
    ans[q[i].second] += temp_num * y[q[i].second] + temp_sum;
  }
  for (long long i : ans) {
    cout << i << " ";
  }
}
