#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 5;
struct node {
  long long x, y, id;
} p[MAXN], sum[MAXN];
vector<int> G[MAXN];
bool cmp(const node &x, const node &y) { return x.x - x.y < y.x - y.y; }
long long n, m, ret[MAXN], pos[MAXN];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lld%lld", &p[i].x, &p[i].y);
  for (int i = 1; i <= n; i++) p[i].id = i;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  sort(p + 1, p + n + 1, cmp);
  for (int i = 1; i <= n; i++) pos[p[i].id] = i;
  for (int i = 1; i <= n; i++) sum[i].x = sum[i - 1].x + p[i].x;
  for (int i = n; i >= 1; i--) sum[i].y = sum[i + 1].y + p[i].y;
  for (int i = 1; i <= n; i++) {
    long long tmpans = 0;
    tmpans = sum[i - 1].x + sum[i + 1].y + (i - 1) * p[i].y + (n - i) * p[i].x;
    for (int j = 0; j < G[p[i].id].size(); j++) {
      int v = pos[G[p[i].id][j]];
      if (v < i)
        tmpans -= (p[i].y + p[v].x);
      else
        tmpans -= (p[i].x + p[v].y);
    }
    ret[p[i].id] = tmpans;
  }
  for (int i = 1; i <= n; i++) printf("%lld ", ret[i]);
  return 0;
}
