#include <bits/stdc++.h>
/*
#include<algorithm>
#include<array>
#include<cassert>
#include<cmath>
#include<cstdlib>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<typeinfo>
#include<utility>
#include<vector>
*/
#define int long long int
#define double long double
using namespace std;
#define INT_DMAX 1000000007
#define INF 1000000000000000007
const int MAX_N = 1 << 17;
#define rep(i, n) for (int(i) = 0, i##_len = (n); (i) < i##_len; (i)++)
#define reps(i, x) for (int(i) = 1; (i) <= (int)(x); (i)++)
#define rrep(i, x) for (int(i) = ((int)(x)-1); (i) >= 0; (i)--)
#define rreps(i, x) for (int(i) = ((int)(x)); (i) > 0; (i)--)
#define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define pb push_back
#define mp make_pair
#define bit(n) ((int)(1) << (n))
#define all(x) (x).begin(), (x).end()
#define debug(x) std::cout << #x << ": " << (x) << std::endl
#define nint int
using namespace std;

int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
typedef pair<int, int> pii;
typedef pair<double, double> dop;
template <class T>
bool chmax(T& a, const T& b)
{
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T& a, const T& b)
{
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
struct aaa {
    aaa()
    {
        cin.tie(0);
        ios::sync_with_stdio(0);
        cout << fixed << setprecision(20);
    };
} aaaaaaa;

const int money = 1e15;
#define maxv (int)(1e5 + 1)
using namespace std;
struct edge {
    int to, cost;
};
typedef pair<int, int> pii;  //firstは最短距離,secondは頂点の番号

int V;
vector<edge> yen[maxv];
vector<edge> snuke[maxv];
int dyen[maxv];
int dsnuke[maxv];
int previy[maxv];
int previs[maxv];

void dijkstra(int s, int* d, int* previ, std::vector<edge>* G)
{
    priority_queue<pii, vector<pii>, greater<pii>> que;
    fill(d, d + V, INF);
    fill(previ, previ + V, -1);
    d[s] = 0;
    que.push(pii(0, s));


    while (!que.empty()) {
        pii p = que.top();
        que.pop();
        int v = p.second;
        if (d[v] < p.first)
            continue;
        for (int i = 0; i < G[v].size(); i++) {
            edge e = G[v][i];
            if (d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                previ[e.to] = v;
                que.push(pii(d[e.to], e.to));
            }
        }
    }
}


signed main()
{
    int n, m, s, t;
    cin >> n >> m >> s >> t;
    V = n;
    for (int i = 0; i < m; i++) {
        int u, v, a, b;
        cin >> u >> v >> a >> b;
        u--;
        v--;
        yen[u].pb(edge{v, a});
        yen[v].pb(edge{u, a});
        snuke[u].pb(edge{v, b});
        snuke[v].pb(edge{u, b});
    }
    s--;
    t--;
    dijkstra(s, dyen, previy, yen);
    dijkstra(t, dsnuke, previs, snuke);
    std::vector<int> mi(n);
    mi[n - 1] = dyen[n - 1] + dsnuke[n - 1];
    for (int i = n - 2; i >= 0; i--) {
        mi[i] = min(mi[i + 1], dyen[i] + dsnuke[i]);
    }
    for (int i = 0; i < n; i++) {
        cout << money - mi[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 20680