import std.stdio, std.string, std.conv;
import std.algorithm, std.array, std.range;
import std.container, std.typecons;
auto solve(string s_){
    immutable nmst = s_.split.map!(to!int).array();
    immutable n=nmst[0], m=nmst[1], s=nmst[2]-1, t=nmst[3]-1;
    auto g = new int[3][][n];
    foreach(i;0..m){
        immutable uvab=readln.split.map!(to!int).array();
        immutable u=uvab[0]-1, v=uvab[1]-1, a=uvab[2], b=uvab[3];
        g[u]~=[v,a,b];
        g[v]~=[u,a,b];
    }
    alias T = Tuple!(long, "m", int, "c", int, "v");
    auto q = heapify!"a<b"([T(10L^^15,n,s)]);
    auto d = new long[n];
    auto c = new long[2][n];
    long[] r; r.reserve(n);
    while(!q.empty()){
        immutable e=q.front(); q.removeFront();
        if(e.c==n){
            if(d[e.v]>=e.m) continue;
            d[e.v]=e.m;
            if(c[e.v][0]<e.m || c[e.v][1]<e.v)
                q.insert(T(e.m,e.v,e.v));
            foreach(ref w;g[e.v]){
                immutable u=w[0], a=e.m-w[1];
                if(d[u]<a) q.insert(T(a,e.c,u));
            }
        }
        else{
            if(c[e.v][0]>=e.m && c[e.v][1]>=e.c) continue;
            if(e.v==t) while(r.length<=e.c) r~=e.m;
            c[e.v][0]=e.m;
            c[e.v][1]=e.c;
            foreach(ref w;g[e.v]){
                immutable u=w[0], b=e.m-w[2];
                if(c[u][0]<b || c[u][1]<e.c) q.insert(T(b,e.c,u));
            }
        }
    }
    return r.map!(to!string).join('\n');
}
void main(){ for(string s; (s=readln.chomp()).length;) writeln(solve(s)); }