#include <bits/stdc++.h>
using namespace std;
long long n, m, ans[300005], xq[300005], yq[300005];
struct pers {
  int x, y, s;
  bool operator<(const pers &b) const { return x - y < b.x - b.y; }
} a[300005];
int main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld%lld", &a[i].x, &a[i].y);
    a[i].s = i;
  }
  for (long long i = 1; i <= m; i++) {
    long long u, v;
    scanf("%lld%lld", &u, &v);
    ans[u] -= min(a[u].x + a[v].y, a[u].y + a[v].x);
    ans[v] -= min(a[u].x + a[v].y, a[u].y + a[v].x);
  }
  sort(a + 1, a + n + 1);
  for (long long i = 1; i <= n; i++) {
    xq[i] = xq[i - 1] + a[i].x;
    yq[i] = yq[i - 1] + a[i].y;
  }
  for (long long i = 1; i <= n; i++) {
    ans[a[i].s] +=
        (i - 1) * a[i].y + (n - i) * a[i].x + xq[i - 1] + yq[n] - yq[i];
  }
  for (long long i = 1; i <= n; i++) {
    cout << ans[i];
    if (i != n) {
      cout << " ";
    }
  }
  return 0;
}
