#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
struct node {
  int id, x, y, d;
} a[maxn];
int n, m;
long long sumx[maxn], sumy[maxn], d[maxn], sum[maxn], ans[maxn];
bool cmp(const node &A, const node &B) { return A.d < B.d; }
long long cal(int x, int y) {
  int id = upper_bound(d + 1, d + n + 1, x - y) - d - 1;
  long long ans =
      sumx[id] + 1LL * id * y + sumy[n] - sumy[id] + 1LL * (n - id) * x;
  return ans - x - y;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i].x, &a[i].y);
    a[i].d = a[i].x - a[i].y;
    a[i].id = i;
  }
  while (m--) {
    int x, y;
    scanf("%d%d", &x, &y);
    sum[x] = sum[x] + min(a[x].x + a[y].y, a[x].y + a[y].x);
    sum[y] = sum[y] + min(a[x].x + a[y].y, a[x].y + a[y].x);
  }
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    sumx[i] = sumx[i - 1] + a[i].x;
    sumy[i] = sumy[i - 1] + a[i].y;
    d[i] = a[i].d;
  }
  for (int i = 1; i <= n; i++)
    ans[a[i].id] = cal(a[i].x, a[i].y) - sum[a[i].id];
  for (int i = 1; i <= n; i++) printf("%lld ", ans[i]);
  return 0;
}
