#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ in >> p.first >> p.second; return in; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }

struct Graph{
    struct Edge{
        int cost, from, dest;
        Edge(int cost, int dest): cost(cost), from(-1), dest(dest){ }
        Edge(int cost, int from, int dest): cost(cost), from(from), dest(dest){ }
        // bool operator == (const Edge& e) const { return cost == e.cost; }
        // bool operator < (const Edge& e) const { return cost < e.cost; }
        // bool operator == (const Edge& e) const { return from == e.from && dest == e.dest; }
        ostream& operator >> (ostream& out) const {
            return out << '(' << cost << ':' << from << ' ' << dest << ')';
        }
    };
    struct Node{
        vector<Edge> edges;
    };
    vector<Node> nodes;
    Graph(int num): nodes(num){ }
    int id(Node* n){ return n - &nodes[0]; }
    int id(Node& n){ return &n - &nodes[0]; }
    // void print(){ for(auto& node : nodes){ prints(id(node), node.outEdges); } }
    void addEdge(int from, int dest, int cost = 1){
        nodes[from].edges.emplace_back(cost, dest);
    }
    void addEdge2(int from, int dest, int cost = 1){
        addEdge(from, dest, cost);
        addEdge(dest, from, cost);
    }
    ll dijkstra2(int start, vector<ll> &lens){
        struct DElem{
            ll cost, dest;
            bool operator < (const DElem& e) const { return cost > e.cost; }
        };
        priority_queue<DElem> pq;
        pq.push({0, start});
        while(pq.size()){
            auto e = pq.top(); pq.pop();
            if(lens[e.dest] <= e.cost){ continue; }
            lens[e.dest] = e.cost;
            printd(lens, e.dest, nodes[e.dest].edges);
            for(auto& edge : nodes[e.dest].edges){
                if(lens[edge.dest] > e.cost + edge.cost){
                    pq.push({e.cost + edge.cost, edge.dest});
                }
            }
        }
        return -1;
    }
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m, s, t;
    cin >> n >> m >> s >> t;
    s--; t--;
    Graph ga(n), gb(n);
    for(int i = 0; i < m; i++){
        int u, v, a, b;
        cin >> u >> v >> a >> b;
        u--; v--;
        ga.addEdge2(u, v, a);
        gb.addEdge2(u, v, b);
    }
    vector<ll> as(n, MLL), bs(n, MLL), cs(n);
    ga.dijkstra2(s, as);
    gb.dijkstra2(t, bs);
    printd(as);
    printd(bs);
    for(int i = 0; i < n; i++){
        cs[i] = as[i] + bs[i];
    }
    prints(cs);
    for(int i = n - 2; i >= 0; i--){
        cs[i] = min(cs[i], cs[i + 1]);
    }
    prints(cs);
    for(int i = 0; i < n; i++){
        cout << (ll)1e15 - cs[i] << '\n';
    }
}


Measured memory_bytes: 17272