#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using P = pair<long long, int>;
const long long INF = 1e18 + 10;

struct Edge {
  int to, w;
  Edge(int t, int w) : to(t), w(w) {}
};

struct Graph {
  int N, M;
  vector<vector<Edge>> edges;

  Graph(int N, int M) : N(N), M(M), edges(N) {}

  void addEdge(int a, int b) { addEdge(a, b, 1); }
  void addEdge(int a, int b, int w) { edges[a].emplace_back(b, w); }

  vector<long long> dist;
  void dijkstra(int s) {
    dist = vector<long long>(N, INF);
    priority_queue<P, vector<P>, greater<P>> pq;
    pq.emplace(0, s);
    while (!pq.empty()) {
      long long d, now;
      tie(d, now) = pq.top();
      pq.pop();
      if (dist[now] != INF) continue;
      dist[now] = d;
      for (Edge e : edges[now]) {
        if (dist[e.to] == INF) pq.emplace(d + e.w, e.to);
      }
    }
  }
};

int main() {
  cout << setprecision(15);
  int n, m, s, t; cin >> n >> m >> s >> t;
  s--; t--;
  Graph Ga(n, m), Gb(n, m);
  rep(i, m) {
    int u, v, a, b; cin >> u >> v >> a >> b;
    u--; v--;
    Ga.addEdge(u, v, a);
    Ga.addEdge(v, u, a);
    Gb.addEdge(u, v, b);
    Gb.addEdge(v, u, b);
  }
  Ga.dijkstra(s);
  Gb.dijkstra(t);

  vector<P> ans(n);
  rep(i, n) ans[i] = P(Ga.dist[i] + Gb.dist[i], i);
  sort(ans.begin(), ans.end());
  int now = 0;
  rep(i, n) {
    while (ans[now].second < i) now++;
    cout << 1e15 - ans[now].first << endl;
  }
}