#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using P = pair<lint, int>;

const lint INF = 1e18;

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  int n, m, s, t; cin >> n >> m >> s >> t;
  s--; t--;
  struct edge { int to, y, s; };
  vector< vector<edge> > G(n, vector<edge>());
  for (int i = 0; i < m; i++) {
    int u, v, a, b; cin >> u >> v >> a >> b;
    u--; v--;
    G[u].push_back(edge{v, a, b});
    G[v].push_back(edge{u, a, b});
  }
  
  vector<lint> dy(n, INF), ds(n, INF);
  queue<P> pq;
  dy[s] = 0;
  pq.push(P(0, s));
  while (not pq.empty()) {
    P p = pq.front(); pq.pop();
    int v = p.second;
    if (dy[v] < p.first) continue;
    for (auto&& e : G[v]) {
      if (dy[v] + e.y < dy[e.to]) {
        dy[e.to] = dy[v] + e.y;
        pq.push(P(dy[e.to], e.to));
      }
    }
  }

  ds[t] = 0;
  pq.push(P(0, t));
  while (not pq.empty()) {
    P p = pq.front(); pq.pop();
    int v = p.second;
    if (ds[v] < p.first) continue;
    for (auto&& e : G[v]) {
      if (ds[v] + e.s < ds[e.to]) {
        ds[e.to] = ds[v] + e.s;
        pq.push(P(ds[e.to], e.to));
      }
    }
  }

  vector<lint> res(n);
  const lint N = 1e15;
  for (int i = 0; i < n; i++) {
    res[i] = N - dy[i] - ds[i];
  }
  for (int i = n - 2; i >= 0; i--) {
    res[i] = max(res[i], res[i + 1]);
  }
  for (int i = 0; i < n; i++) {
    cout << res[i] << '\n';
  }
  return 0;
}
