#include <iostream>
#include <fstream>
#include <vector>
#include <utility>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <queue>
#include <stack>
#include <forward_list>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <string>
#include <bitset>
#include <memory>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <cstdint>
#include <iomanip>
#include <tuple>

#include <queue>
#include <utility>
#include <vector>
#include <map>
template <class Tdist,class Tnode>
class djikstra {
private:
    class path {
    public:
        Tdist cost;
        unsigned int src;
        unsigned int dst;
        bool operator< (const struct path& obj) const {
            return src < obj.src;
        }
    };
    class node {
    public:
        Tdist dist;
        bool reachable;
        node() {
            reachable = false;
            dist = 0;
        }
    };
    std::vector<path> paths;
    std::vector<node> nodes;
    std::unordered_map<Tnode,unsigned int> r_node_name;
public:
    djikstra() {
        initialize();
    }
    void initialize() {
        nodes.clear();
        paths.clear();
        r_node_name.clear();
    }
    void add_path(Tdist cost,Tnode src,Tnode dst) {
        path temp;
        auto src_i = r_node_name.find(src);
        auto dst_i = r_node_name.find(dst);
        if(src_i == r_node_name.end()) {
            nodes.push_back(node());
            r_node_name.insert(std::make_pair(src,nodes.size()-1));
            src_i = r_node_name.find(src);
        }
        if(dst_i == r_node_name.end()) {
            nodes.push_back(node());
            r_node_name.insert(std::make_pair(dst,nodes.size()-1));
            dst_i = r_node_name.find(dst);
        }
        temp.cost = cost;
        temp.src = src_i->second;
        temp.dst = dst_i->second;
        paths.push_back(temp);
    }
    Tdist get_distance(Tnode node) {
        auto node_i = r_node_name.find(node);
        if(node_i == r_node_name.end())
            throw "Invalid node name";
        return nodes[node_i->second].dist;
    }
    void compute(Tnode start,Tdist initial_cost) {
        sort(paths.begin(),paths.end());
        for(auto& n:nodes)
            n.reachable = false;
        auto start_i = r_node_name.find(start);
        if(start_i == r_node_name.end())
            throw "Invalid node name";
        unsigned int start_n = start_i->second;
        nodes[start_n].reachable = true;
        std::priority_queue<std::pair<Tdist, unsigned int>,std::vector<std::pair<Tdist, unsigned int>>,std::greater<std::pair<Tdist, unsigned int>>> open;
        std::unordered_set<unsigned int> close;
        open.push(std::make_pair(initial_cost,start_n));
        while (!open.empty()) {
            auto least = open.top();
            open.pop();
            if(least.first == nodes[least.second].dist && close.find(least.second) == close.end()) {
                close.insert(least.second);
                path temp;
                temp.src = least.second;
                auto rg = std::equal_range(paths.begin(),paths.end(),temp);
                for(auto itr = rg.first;itr != rg.second;itr++) {
                    if(nodes[itr->dst].reachable == false || nodes[itr->dst].dist > nodes[itr->src].dist + itr->cost) {
                        nodes[itr->dst].reachable = true;
                        nodes[itr->dst].dist = nodes[itr->src].dist + itr->cost;
                        open.push(std::make_pair(nodes[itr->dst].dist,itr->dst));
                    }
                }
            }
        }
    }
};

using  namespace std;
#define MAXM 100000
int main(void) {
    int n,m,s,t,u[MAXM],v[MAXM],a[MAXM],b[MAXM];
    cin >> n >> m >> s >> t;
    for(int i = 0;i < m;i++)
        cin >> u[i] >>v[i] >>a[i] >>b[i];
    djikstra<long long, unsigned int> d[2];
    for(int i = 0;i < m;i++) {
        d[0].add_path(a[i], v[i], u[i]);
        d[0].add_path(a[i], u[i], v[i]);
        d[1].add_path(b[i], v[i], u[i]);
        d[1].add_path(b[i], u[i], v[i]);
    }
    d[0].compute(s, 0);
    d[1].compute(t, 0);
    long long int sum[MAXM+1];
    long long int cur = 0x7000000000000000;
    for(int i = n;i != 0;i--) {
        sum[i] = d[0].get_distance(i) + d[1].get_distance(i);
        cur = min(cur,sum[i]);
        sum[i] = cur;
        sum[i] = pow(10,15) - sum[i];
    }
    for(int i = 1;i <= n;i++)
        cout << sum[i] << endl;
    return 0;
}


Measured memory_bytes: 24252