#include <bits/stdc++.h>
using namespace std;
int x[65536 * 8], y[65536 * 8];
vector<int> hate[65536 * 8];
struct SEGTREE {
  long long tree[65536 * 8 * 2 + 10];
  void update(int x, int y) {
    x += 65536 * 8 - 1;
    while (x) {
      tree[x] += y, x /= 2;
    }
  }
  long long query(int a, int b, int l, int r, int id) {
    if (a > b) return 0;
    if (l >= a and r <= b) return tree[id];
    int mid = (l + r) / 2;
    long long sum = 0;
    if (a <= mid) sum += query(a, b, l, mid, id * 2);
    if (b > mid) sum += query(a, b, mid + 1, r, id * 2 + 1);
    return sum;
  }
} sx, sy, sn;
int n, m;
set<int> qzr;
map<int, int> wzy;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    scanf("%d%d", &x[i], &y[i]), hate[i].push_back(i), qzr.insert(x[i] - y[i]);
  for (int i = 0; i < m; i++) {
    int xx, yy;
    scanf("%d%d", &xx, &yy);
    hate[xx].push_back(yy);
    hate[yy].push_back(xx);
  }
  int tot = 0;
  for (set<int>::iterator it = qzr.begin(); it != qzr.end(); it++)
    wzy[*it] = ++tot;
  for (int i = 1; i <= n; i++) {
    int t = wzy[x[i] - y[i]];
    sx.update(t, x[i]);
    sy.update(t, y[i]);
    sn.update(t, 1);
  }
  for (int i = 1; i <= n; i++) {
    long long ans = 0;
    int t = wzy[x[i] - y[i]];
    for (int j = 0; j < hate[i].size(); j++) {
      int ct = hate[i][j];
      ans -= min(x[i] + y[ct], x[ct] + y[i]);
    }
    ans += sx.query(1, t - 1, 1, 65536 * 8, 1) +
           sn.query(1, t - 1, 1, 65536 * 8, 1) * y[i];
    ans += sy.query(t, 65536 * 8, 1, 65536 * 8, 1) +
           sn.query(t, 65536 * 8, 1, 65536 * 8, 1) * x[i];
    printf("%lld ", ans);
  }
  return 0;
}
