#include <bits/stdc++.h>
using namespace std;
long long x[300000 + 342];
long long y[300000 + 342];
vector<pair<long long, int> > difference;
long long pref[300000 + 342];
long long suff[300000 + 342];
long long ans[300000 + 342];
vector<int> avoid[300000 + 342];
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    cin >> y[i];
    difference.push_back(make_pair(x[i] - y[i], i));
  }
  int xxx, yyy;
  for (int i = 0; i < m; i++) {
    cin >> xxx >> yyy;
    xxx--;
    yyy--;
    avoid[xxx].push_back(yyy);
    avoid[yyy].push_back(xxx);
  }
  sort(difference.begin(), difference.end());
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      pref[i] = x[difference[i].second];
    } else {
      pref[i] = pref[i - 1] + x[difference[i].second];
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    suff[i] = suff[i + 1] + y[difference[i].second];
  }
  for (int i = 0; i < n; i++) {
    int index = difference[i].second;
    long long res = 0;
    if (i == 0) {
      res = suff[i + 1] + ((long long)i * y[index]) +
            ((long long)(n - i - 1LL) * x[index]);
    } else {
      res = suff[i + 1] + pref[i - 1] + ((long long)i * y[index]) +
            ((long long)(n - i - 1LL) * x[index]);
    }
    for (auto bc : avoid[index]) {
      long long diff = x[bc] - y[bc];
      if (diff < difference[i].first) {
        res -= x[bc] + y[index];
      } else {
        res -= x[index] + y[bc];
      }
    }
    ans[index] = res;
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
