#include <bits/stdc++.h>
using namespace std;
int n, m;
struct node {
  long long id, x, y;
  bool operator<(const node t) const { return x - y < t.x - t.y; }
} a[300005];
long long px[300005], py[300005], sx[300005], sy[300005];
long long p[300005][2], s[300005][2];
long long ans[300005];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld%lld", &a[i].x, &a[i].y);
    a[i].id = i;
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    if (a[u].x - a[u].y < a[v].x - a[v].y) {
      s[u][0]++;
      s[u][1] += a[v].y;
      p[v][0]++;
      p[v][1] += a[u].x;
    } else {
      s[v][0]++;
      s[v][1] += a[u].y;
      p[u][0]++;
      p[u][1] += a[v].x;
    }
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    px[i] = px[i - 1] + a[i].x;
    py[i] = py[i - 1] + a[i].y;
  }
  for (int i = n; i >= 1; i--) {
    sx[i] = sx[i + 1] + a[i].x;
    sy[i] = sy[i + 1] + a[i].y;
  }
  for (int i = 1; i <= n; i++) {
    int j = a[i].id;
    ans[j] = px[i - 1] - p[j][1] + (i - 1 - p[j][0]) * a[i].y + sy[i + 1] -
             s[j][1] + (n - i - s[j][0]) * a[i].x;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
