#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300005;
struct node {
  int id;
  int x;
  int y;
} a[MAXN];
int n;
int m;
bool cmp(node a, node b) { return a.x + b.y < a.y + b.x; }
long long ans[MAXN];
long long sumx[MAXN];
long long sumy[MAXN];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &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);
    int temp = min(a[u].x + a[v].y, a[u].y + a[v].x);
    ans[u] -= (long long)temp;
    ans[v] -= (long long)temp;
  }
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    sumx[i] = sumx[i - 1] + (long long)a[i].x;
    sumy[i] = sumy[i - 1] + (long long)a[i].y;
  }
  for (int i = 1; i <= n; i++) {
    long long temp = 0;
    temp += (long long)(n - i) * (long long)a[i].x;
    temp += sumy[n] - sumy[i];
    temp += (long long)(i - 1) * (long long)a[i].y;
    temp += sumx[i - 1];
    ans[a[i].id] += temp;
  }
  for (int i = 1; i < n; i++) {
    cout << ans[i] << " ";
  }
  cout << ans[n] << endl;
  return 0;
}
