#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int _inf = 0xc0c0c0c0;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long _INF = 0xc0c0c0c0c0c0c0c0;
const long long mod = (int)1e9 + 7;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long ksm(long long a, long long b, long long mod) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
long long inv2(long long a, long long mod) { return ksm(a, mod - 2, mod); }
const int MAX_N = 300025;
struct node {
  long long x, y, id;
} arr[MAX_N], arr_[MAX_N];
bool cmp(node a, node b) { return a.x - a.y > b.x - b.y; }
long long sumx[MAX_N], sumy[MAX_N], ans[MAX_N];
vector<int> G[MAX_N];
int main() {
  int n, m, a, b;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld%lld", &arr[i].x, &arr[i].y);
    arr[i].id = i;
    arr_[i].x = arr[i].x, arr_[i].y = arr[i].y;
  }
  while (m--) {
    scanf("%d%d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  sort(arr + 1, arr + 1 + n, cmp);
  for (int i = 1; i <= n; ++i)
    sumx[i] = sumx[i - 1] + arr[i].x, sumy[i] = sumy[i - 1] + arr[i].y;
  for (int i = 1; i <= n; ++i) {
    ans[arr[i].id] += sumy[i - 1] + (i - 1) * arr[i].x + (n - i) * arr[i].y +
                      sumx[n] - sumx[i];
    for (int j = 0; j < G[arr[i].id].size(); j++) {
      int to = G[arr[i].id][j];
      long long minn = min(arr[i].x + arr_[to].y, arr[i].y + arr_[to].x);
      ans[arr[i].id] -= minn;
    }
  }
  for (int i = 1; i <= n; ++i)
    i == n ? printf("%lld\n", ans[i]) : printf("%lld ", ans[i]);
  return 0;
}
