#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
const int MAXN = 3e5 + 5, inf = 1e9;
const ll INF = 1e18;
const ld PI = 3.1415926535897932384626433832795;
struct ziom {
  ll x, y, res;
  int pos;
  bool operator<(const ziom &b) const { return x - y < b.x - b.y; }
};
ziom tab[MAXN];
ll sumX[MAXN], sumY[MAXN], res[MAXN];
ll SumX(int a, int b) {
  if (a == 0) return sumX[b];
  return sumX[b] - sumX[a - 1];
}
ll SumY(int a, int b) {
  if (a == 0) return sumY[b];
  return sumY[b] - sumY[a - 1];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << setprecision(13) << fixed;
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> tab[i].x >> tab[i].y;
    tab[i].pos = i;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    tab[a].res -= min(tab[a].x + tab[b].y, tab[a].y + tab[b].x);
    tab[b].res -= min(tab[a].x + tab[b].y, tab[a].y + tab[b].x);
  }
  sort(tab + 1, tab + n + 1);
  for (int i = 1; i <= n; i++) {
    sumX[i] = sumX[i - 1] + tab[i].x;
    sumY[i] = sumY[i - 1] + tab[i].y;
  }
  for (int i = 1; i <= n; i++) {
    tab[i].res += (i - 1) * tab[i].y + SumX(1, i - 1) + (n - i) * tab[i].x +
                  SumY(i + 1, n);
  }
  sort(tab + 1, tab + n + 1, [](ziom a, ziom b) { return a.pos < b.pos; });
  for (int i = 1; i <= n; i++) {
    cout << tab[i].res << " ";
  }
  cout << "\n";
}
