#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const long long LINF = 1LL * INF * INF;
pair<int, int> arr[300007];
long long ans[300007];
int n, m;
pair<long long, int> a[300007];
long long pref1[300007];
long long pref2[300007];
void calc() {
  long long sum = 0;
  for (int i = 0; i < n; ++i) sum += arr[i].second;
  for (int i = 0; i < n; ++i) a[i] = make_pair(arr[i].first - arr[i].second, i);
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    pref1[i] += arr[a[i].second].first;
    if (i) pref1[i] += pref1[i - 1];
    pref2[i] += arr[a[i].second].second;
    if (i) pref2[i] += pref2[i - 1];
  }
  for (int i = 0; i < n; ++i) {
    long long dif = 1LL * arr[i].first - 1LL * arr[i].second;
    int k = upper_bound(a, a + n, make_pair(dif, INF)) - a;
    k--;
    ans[i] += 1LL * pref1[k] + (k + 1) * (long long)arr[i].second +
              (n - k - 1) * (long long)arr[i].first + 1LL * sum - pref2[k];
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i].first >> arr[i].second;
  }
  calc();
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    long long x =
        min(arr[a].first + arr[b].second, arr[a].second + arr[b].first);
    ans[a] -= x;
    ans[b] -= x;
  }
  for (int i = 0; i < n; ++i)
    cout << ans[i] - 1LL * arr[i].first - 1LL * arr[i].second << " ";
  return 0;
}
