#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 9;
struct node {
  long long x, y, id, sub, val;
} a[maxn];
bool cmp(node a, node b) { return a.sub < b.sub; }
long long pre[maxn], suf[maxn], res[maxn];
vector<long long> Sub[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int i, j, n, m;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> a[i].x >> a[i].y;
    a[i].id = i;
    a[i].sub = a[i].x - a[i].y;
  }
  for (i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    long long val = min(a[u].x + a[v].y, a[u].y + a[v].x);
    Sub[u].push_back(val);
    Sub[v].push_back(val);
  }
  sort(a + 1, a + n + 1, cmp);
  for (i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] + a[i].y;
    suf[i] = suf[i - 1] + a[i].x;
  }
  for (i = n; i >= 1; i--) {
  }
  for (i = 1; i <= n; i++) {
    int id = a[i].id;
    res[id] =
        pre[n] - pre[i] + a[i].x * (n - i) + suf[i - 1] + a[i].y * (i - 1);
    int len = Sub[id].size();
    for (j = 0; j < len; j++) {
      res[id] -= Sub[id][j];
    }
  }
  for (i = 1; i <= n; i++) {
    if (i != n)
      cout << res[i] << ' ';
    else {
      cout << res[i] << endl;
    }
  }
}
