#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300100;
struct str {
  long long id, x, y, menos;
  str() { menos = 0; }
};
str p[MAXN];
long long sx[MAXN], sy[MAXN];
long long resp[MAXN];
bool comp(str a, str b) { return (a.y - a.x) < (b.y - b.x); }
signed main() {
  memset(resp, 0, sizeof resp);
  long long n, m;
  scanf("%I64d %I64d", &n, &m);
  for (long long i = 1; i <= n; i++) {
    long long x, y;
    cin >> x >> y;
    p[i].id = i, p[i].x = x, p[i].y = y;
  }
  for (long long i = 1; i <= m; i++) {
    long long x, y;
    scanf("%I64d %I64d", &x, &y);
    if (p[x].y - p[x].x > p[y].y - p[y].x)
      p[x].menos += p[x].x + p[y].y, p[y].menos += p[y].y + p[x].x;
    else
      p[x].menos += p[x].y + p[y].x, p[y].menos += p[x].y + p[y].x;
  }
  sort(p + 1, p + n + 1, comp);
  sx[0] = 0;
  sy[0] = 0;
  for (long long i = 1; i <= n; i++) {
    sx[i] = p[i].x + sx[i - 1];
    sy[i] = p[i].y + sy[i - 1];
  }
  for (long long i = 1; i <= n; i++) {
    resp[p[i].id] += sy[i - 1] + p[i].x * (i - 1);
    resp[p[i].id] += sx[n] - sx[i] + p[i].y * (n - i);
    resp[p[i].id] -= p[i].menos;
  }
  for (long long i = 1; i <= n; i++) {
    printf("%I64d ", resp[i]);
  }
}
