#include <bits/stdc++.h>
using namespace std;
long long int inf = 1e15;
long long int mod = 1e9 + 7;
char en = '\n';
long long int bit1[300005], bit2[300005], bit3[300005];
long long int n1;
void update1(long long int indx, long long int val) {
  while (indx <= n1) {
    bit1[indx] += val;
    indx += indx & (-indx);
  }
}
long long int query1(long long int indx) {
  long long int sum1 = 0;
  while (indx >= 1) {
    sum1 += bit1[indx];
    indx -= indx & (-indx);
  }
  return sum1;
}
void update2(long long int indx, long long int val) {
  while (indx <= n1) {
    bit2[indx] += val;
    indx += indx & (-indx);
  }
}
long long int query2(long long int indx) {
  long long int sum1 = 0;
  while (indx >= 1) {
    sum1 += bit2[indx];
    indx -= indx & (-indx);
  }
  return sum1;
}
void update3(long long int indx, long long int val) {
  while (indx <= n1) {
    bit3[indx] += val;
    indx += indx & (-indx);
  }
}
long long int query3(long long int indx) {
  long long int sum1 = 0;
  while (indx >= 1) {
    sum1 += bit3[indx];
    indx -= indx & (-indx);
  }
  return sum1;
}
vector<long long int> arr[300005];
long long int val[300005];
long long int a[300005], b[300005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  map<long long int, long long int> par;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
    par[a[i] - b[i]];
  }
  long long int cnt = 0;
  for (auto &it : par) it.second = ++cnt;
  n1 = cnt;
  for (long long int i = 1; i <= n; i++) arr[i].push_back(i);
  for (long long int i = 1; i <= m; i++) {
    long long int x, y;
    cin >> x >> y;
    arr[x].push_back(y);
    arr[y].push_back(x);
  }
  for (long long int i = 1; i <= n; i++) {
    val[i] = par[a[i] - b[i]];
  }
  memset(bit1, 0, sizeof(bit1));
  memset(bit2, 0, sizeof(bit2));
  memset(bit3, 0, sizeof(bit3));
  for (long long int i = 1; i <= n; i++) {
    update1(val[i], a[i]);
    update2(val[i], 1);
    update3(val[i], b[i]);
  }
  for (long long int i = 1; i <= n; i++) {
    for (long long int x : arr[i]) {
      update1(val[x], -a[x]);
      update2(val[x], -1);
      update3(val[x], -b[x]);
    }
    long long int sum1 = 0;
    long long int val3 = val[i];
    long long int value = query3(val3 - 1);
    sum1 = query3(cnt) - value;
    long long int cnt1 = query2(cnt) - query2(val3 - 1);
    long long int curr = 0;
    curr = sum1 + cnt1 * a[i];
    sum1 = query1(val3 - 1);
    cnt1 = query2(val3 - 1);
    curr += sum1 + cnt1 * b[i];
    cout << curr << " ";
    for (long long int x : arr[i]) {
      update1(val[x], a[x]);
      update2(val[x], 1);
      update3(val[x], b[x]);
    }
  }
  cout << en;
  return 0;
}
