#include <bits/stdc++.h>
using namespace std;
int read() {
  char ch = getchar();
  int x = 0, y = 1;
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') {
    y = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * y;
}
const int N = 3e5 + 5;
struct node {
  long long delta;
  int id;
} a[N];
int cmp(node a, node b) { return a.delta < b.delta; }
int n, m;
long long sum1[N], sum2[N], ans[N], pls[N];
int x[N], y[N];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    a[i].id = i;
    x[i] = read(), y[i] = read();
  }
  for (int i = 1; i <= m; ++i) {
    int u = read(), v = read();
    long long aa = x[u] + y[v];
    long long bb = x[v] + y[u];
    if (aa < bb) {
      pls[u] += aa;
      pls[v] += aa;
    } else {
      pls[u] += bb;
      pls[v] += bb;
    }
  }
  for (int i = 1; i <= n; ++i) a[i].delta = x[i] - y[i];
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; ++i) sum1[i] = sum1[i - 1] + x[a[i].id];
  for (int i = n; i >= 1; --i) sum2[i] = sum2[i + 1] + y[a[i].id];
  for (int i = 1; i <= n; ++i) {
    int id1 = a[i].id;
    long long aa = x[id1];
    long long bb = y[id1];
    if (i > 1) ans[id1] += (i - 1) * bb + sum1[i - 1];
    if (i < n) ans[id1] += (n - i) * aa + sum2[i + 1];
  }
  for (int i = 1; i <= n; ++i) cout << ans[i] - pls[i] << ' ';
  cout << endl;
  return 0;
}
