#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <bitset>
#include <sstream>
#include <cstdlib>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <random>
#include <functional>
#include <climits>
#include <cstdio>
#include <ctype.h>
#include <time.h>
using namespace std;

#define PI acos(-1.0)
#define EPS 1e-8
#define MOD 1000000007
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
#define go(i, a, b) for(int i = a; i <= b; ++i)
#define gorev(i, a, b) for(int i = a; i >= b; --i)

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

template <class L, class R> ostream &operator <<(ostream &os, pair<L, R> P){
    return os << "(" << P.fi << "," << P.se << ")";
}
template <class T> ostream &operator <<(ostream &os, vector<T> V){
    os << "["; for (auto vv: V) os << vv << ","; return os << "]";
}
template <class L, class R> ostream &operator <<(ostream &os, map<L, R> M){
    os << "["; for (auto pr: M) os << pr.fi << "->" << pr.se << ","; return os << "]";
}
template <class L, class R> ostream &operator <<(ostream &os, unordered_map<L, R> M){
    os << "["; for (auto pr: M) os << pr.fi << "->" << pr.se << ","; return os << "]";
}

mt19937_64 mt(time(0));

struct Matrix {
    vvi data;
    int r, c;
    Matrix(int row, int col, bool identity = false) : r(row), c(col) {
        data.assign(row, vector<int>(col, 0));
        if (identity) {
            for (int i = 0; i < r; ++i) {
                data[i][i] = 1;
            }
        }
    }
    Matrix operator * (Matrix& other) {
        int m = r, n = c, p = other.c;
        Matrix res(m, p);
        for (int i = 0; i < m; ++i) {
            for (int j = 0; j < p; ++j) {
                for (int k = 0; k < n; ++k) {
                    res.data[i][j] += data[i][k] * other.data[k][j];
                }
            }
        }
        return res;
    }
};

vector<int> extendGcd(int a, int b) {
    if (b == 0) {
        return {1, 0, a};
    } else {
        vector<int> tmp = extendGcd(b, a % b);
        return {tmp[1], tmp[0] - (a / b) * tmp[1], tmp[2]};
    }
}

Matrix matrix_power(Matrix base, ll exp) {
    int n = base.r;
    Matrix res(n, n, true);
    while (exp) {
        if (exp & 1) {
            res = res * base;
        }
        base = base * base;
        exp >>= 1;
    }
    return res;
}

inline char get(void) {
    static char buf[100000], *S = buf, *T = buf;
    if (S == T) {
        T = (S = buf) + fread(buf, 1, 100000, stdin);
        if (S == T) return EOF;
    }
    return *S++;
}

template<class T> inline void read(T &x) {
    static char c; x = 0; int sgn = 0;
    for (c = get(); c < '0' || c > '9'; c = get()) if (c == '-') sgn = 1;
    for (; c >= '0' && c <= '9'; c = get()) x = x * 10 + c - '0';
    if (sgn) x = -x;
}

/*************************
 ******* template ********
 ************************/
#define N 100010
const ll INF = (ll)1e15;
int n, m, s, t;
struct edge {
    int to;
    ll a;
    ll b;
};
vector<edge> e[N];
ll yen[N], snu[N];
int ok[N];
ll res[N];

void solveyen() {
    memset(ok, 0, sizeof(ok));
    go(i, 1, n) yen[i] = INF;
    auto cmp = [](pair<int, ll> a, pair<int, ll> b) {
        return a.second > b.second;
    };
    priority_queue<pair<int, ll>, vector<pair<int, ll>>, decltype(cmp)> pq(cmp);
    pq.push({s, 0});
    yen[s] = 0;
    while (!pq.empty()) {
        auto pr = pq.top();
        pq.pop();
        if (ok[pr.fi]) continue;
        ok[pr.fi] = 1;
        for (auto next : e[pr.fi]) {
            if (!ok[next.to] && pr.se + next.a < yen[next.to]) {
                yen[next.to] = pr.se + next.a;
                pq.push({next.to, yen[next.to]});
            }
        }
    }
}

void solvesnu() {
    memset(ok, 0, sizeof(ok));
    go(i, 1, n) snu[i] = INF;
    auto cmp = [](pair<int, ll> a, pair<int, ll> b) {
        return a.second > b.second;
    };
    priority_queue<pair<int, ll>, vector<pair<int, ll>>, decltype(cmp)> pq(cmp);
    pq.push({t, 0});
    snu[t] = 0;
    while (!pq.empty()) {
        auto pr = pq.top();
        pq.pop();
        if (ok[pr.fi]) continue;
        ok[pr.fi] = 1;
        for (auto next : e[pr.fi]) {
            if (!ok[next.to] && pr.se + next.b < snu[next.to]) {
                snu[next.to] = pr.se + next.b;
                pq.push({next.to, snu[next.to]});
            }
        }
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.precision(10);
    cout << fixed;
#ifdef ZYC_LOCAL
    freopen("input.txt", "rt", stdin);
#endif
    cin >> n >> m >> s >> t;
    int u, v, a, b;
    go(i, 1, m) {
        cin >> u >> v >> a >> b;
        e[u].push_back({v, a, b});
        e[v].push_back({u, a, b});
    }
    solveyen();
    solvesnu();

    ll tmp = INF;
    gorev(i, n - 1, 0) {
        tmp = min(tmp, yen[i + 1] + snu[i + 1]);
        res[i] = INF - tmp;
    }
    go(i, 0, n - 1) {
        cout << res[i] << endl;
    }

#ifdef ZYC_LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}


Measured memory_bytes: 14948