#include <bits/stdc++.h>
using namespace std;
int n, m;
int x[300005], y[300005];
long long pre_x[300005], suf_y[300005];
int sorted_id[300005];
vector<int> person[300005];
struct Z {
  int id;
  long long key;
} z[300005];
bool cmp(Z t1, Z t2) { return t1.key < t2.key; }
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x[i], &y[i]);
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    person[u].push_back(v);
    person[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    z[i].id = i;
    z[i].key = (long long)x[i] - y[i];
  }
  sort(z + 1, z + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    sorted_id[z[i].id] = i;
  }
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += (long long)x[z[i].id];
    pre_x[i] = sum;
  }
  sum = 0;
  for (int i = n; i >= 1; i--) {
    sum += (long long)y[z[i].id];
    suf_y[i] = sum;
  }
  for (int i = 1; i <= n; i++) {
    int pos = sorted_id[i];
    long long ans = 0;
    ans = (pos - 1) * (long long)y[i] + (n - pos) * (long long)x[i];
    ans += pre_x[pos - 1] + suf_y[pos + 1];
    int len = person[i].size();
    for (int j = 0; j < len; j++) {
      int t = person[i][j];
      ans -= min(x[i] + y[t], x[t] + y[i]);
    }
    cout << ans << " ";
  }
  cout << endl;
  return 0;
}
