#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<long long> tree;
constexpr long long query_default = 0;
long long combine(long long a, long long b) { return a + b; }
void init(long long n) { tree = vector<long long>(n * 2); }
void modify(long long l, long long r, long long value) {
  for (l += tree.size() / 2, r += tree.size() / 2; l < r; l /= 2, r /= 2) {
    if (l & 1) {
      tree[l] = combine(tree[l], value);
      l++;
    };
    if (r & 1) {
      --r;
      tree[r] = combine(value, tree[r]);
    };
  }
}
long long query(long long p) {
  long long res = query_default;
  for (p += tree.size() / 2; p > 0; p = p / 2) res = combine(res, tree[p]);
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n);
  vector<long long> y(n);
  vector<pair<long long, long long>> diff(n);
  for (long long i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    diff[i] = {x[i] - y[i], i};
  }
  vector<long long> res(n);
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    long long z = min(x[a] + y[b], x[b] + y[a]);
    res[a] -= z;
    res[b] -= z;
  }
  sort(diff.begin(), diff.end());
  init(n);
  vector<long long> inv(n);
  for (long long i = 0; i < n; i++) {
    long long j = diff[i].second;
    inv[j] = i;
    modify(0, i, y[j]);
    modify(i + 1, n, x[j]);
    res[j] += i * y[j] + (n - (i + 1)) * x[j];
  }
  for (long long i = 0; i < n; i++) {
    long long j = inv[i];
    cout << res[i] + query(j) << " ";
  }
  cout << endl;
}
