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

enum inf = 1_001_001_001;
enum infl = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;

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

void main() {
    int N, M, s, t;
    scan(N, M, s, t); s--, t--;
    auto adjs = new Edge[][](N, 0);
    auto adjt = new Edge[][](N, 0);
    foreach (i ; 0 .. M) {
        int ui, vi, ai, bi;
        scan(ui, vi, ai, bi);
        ui--, vi--;
        adjs[ui] ~= Edge(vi, ai);
        adjs[vi] ~= Edge(ui, ai);
        adjt[vi] ~= Edge(ui, bi);
        adjt[ui] ~= Edge(vi, bi);
    }

    auto ds = dijkstra(adjs, s);
    auto dt = dijkstra(adjt, t);

    debug {
        writeln(ds);
        writeln(dt);
    }

    auto dd = new long[](N);
    foreach (i ; 0 .. N) {
        dd[i] = ds[i] + dt[i];
    }

    auto ans = new long[](N);
    ans[N - 1] = 10L^^15 - dd[N - 1];
    foreach_reverse (i ; 0 .. N - 1) {
        ans[i] = max(ans[i + 1], 10L^^15 - dd[i]);
    }

    writefln("%(%s\n%)", ans);
}

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

    int N = adj.length.to!int;

    auto dist = new long[](N);
    dist[] = infl;
    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);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}
