import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

alias Edge = Tuple!(int, "to", int, "cost");

void main() {
    int n, m, s, t;
    scan(n, m, s, t);
    s--, t--;

    auto adj = new Edge[][](n, 0);
    auto adjr = new Edge[][](n, 0);

    foreach (i ; 0 .. m) {
        int ui, vi, ai, bi;
        scan(ui, vi, ai, bi);
        ui--, vi--;
        adj[ui] ~= Edge(vi, ai);
        adj[vi] ~= Edge(ui, ai);
        adjr[ui] ~= Edge(vi, bi);
        adjr[vi] ~= Edge(ui, bi);
    }

    auto yuki = dijkstra(adj, s);
    auto kaeri = dijkstra(adjr, t);

    debug {
        writeln(yuki);
        writeln(kaeri);
    }

    long[] ans = new long[](n);

    ans[n-1] = yuki[n-1] + kaeri[n-1];

    foreach_reverse (i ; 0 .. n-1) {
        ans[i] = min(ans[i+1], yuki[i] + kaeri[i]);
    }

    foreach (i ; 0 .. n) {
        writeln(10L^^15 - ans[i]);
    }
}




auto dijkstra(Edge[][] adj, int s) {
    alias Pair = Tuple!(int, "num", long, "dist");
    immutable inf = 10L^^18;

    int N = adj.length.to!int;

    auto dist = new long[](N);
    dist[] = inf;
    dist[s] = 0;

    auto q = BinaryHeap!(Array!Pair, "a.dist > b.dist")();
    q.insert(Pair(s, 0));

    int rep = N - 1;

    while (!q.empty && rep) {
        auto v = q.front;
        q.popFront();

        if (dist[v.num] < v.dist) continue;

        rep--;

        foreach (e ; adj[v.num]) {
            if (dist[e.to] > dist[v.num] + e.cost) {
                dist[e.to] = dist[v.num] + e.cost;
                q.insert(Pair(e.to, dist[e.to]));
            }
        }
    }

    return dist;
}







































void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
