#include <bits/stdc++.h>
using namespace std;

typedef pair<int, int> P;
int n, m, s, t;
vector<P> graph[100001];

vector<long long> dijkstra(int start, vector<int> costs) {
  priority_queue<P, vector<P>, greater<P> > que;
  vector<long long> d(n);
  for (int i=0; i<n; i++) d[i] = 1e14;

  d[start] = 0;
  que.push(P(0, start));

  while (!que.empty()) {
    P p = que.top();
    que.pop();
    int v = p.second;
    if (d[v] < p.first) continue;
    for (int i=0; i<graph[v].size(); i++) {
      auto e = graph[v][i];
      if (d[e.first] > d[v] + costs[e.second]) {
        d[e.first] = d[v] + costs[e.second];
        que.push(P(d[e.first], e.first));
      }
    }
  }
  return d;
}
int main() {

  cin>>n>>m>>s>>t;
  --s;
  --t;
  vector<int> a(m), b(m);
  for (int i=0; i<m; i++) {
    int ui, vi;
    cin>>ui>>vi>>a[i]>>b[i];
    --ui;
    --vi;
    graph[ui].push_back(P(vi, i));
    graph[vi].push_back(P(ui, i));
  }
  vector<long long> d_yen = dijkstra(s, a);
  vector<long long> d_snk = dijkstra(t, b);

  vector<long long> ans;
  long long init = 1e15;
  ans.push_back(1e15 - d_yen[n-1] - d_snk[n-1]);
  for (int i=1; i<n; i++) {
    long long tmp = 1e15 - d_yen[n-i-1] - d_snk[n-i-1];
    ans.push_back(max(tmp, ans[i-1]));
  }
  reverse(ans.begin(), ans.end());
  for (auto a: ans) {
    cout<<a<<endl;
  }
}