#include <bits/stdc++.h>
using namespace std;
pair<int, int> num[300005];
int x[300005], y[300005];
long long cum_x[300005], cum_y[300005];
long long ans[300005];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &x[i], &y[i]);
    num[i] = {y[i] - x[i], i};
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    long long tmp = min(x[u] + y[v], y[u] + x[v]);
    ans[u] -= tmp;
    ans[v] -= tmp;
  }
  sort(num + 1, num + n + 1);
  for (int i = 1; i <= n; i++) {
    int tmp = num[i].second;
    cum_y[i] = cum_y[i - 1] + y[tmp];
  }
  for (int i = n; i >= 1; i--) {
    int tmp = num[i].second;
    cum_x[i] = cum_x[i + 1] + x[tmp];
  }
  for (int i = 1; i <= n; i++) {
    int ind = num[i].second;
    long long tmp = cum_y[i - 1] + cum_x[i + 1] + 1LL * (i - 1) * x[ind] +
                    1LL * (n - i) * y[ind];
    ans[ind] += tmp;
  }
  for (int i = 1; i <= n; i++) {
    printf("%lld ", ans[i]);
  }
  printf("\n");
  return 0;
}
