#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <tuple>
using namespace std;
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl(long(n))
#define coutf cout << fixed << setprecision(10)

template< typename T >
struct edge {
    int src, to;
    T cost;
    
    edge(int to, T cost) : src(-1), to(to), cost(cost) {}
    
    edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
    
    edge &operator=(const int &x) {
        to = x;
        return *this;
    }
    
    operator int() const { return to; }
};

template< typename T >
using Edges = vector< edge< T > >;
template< typename T >
using WeightedGraph = vector< Edges< T > >;
using UnWeightedGraph = vector< vector< int > >;
template< typename T >
using Matrix = vector< vector< T > >;

template< typename T >
vector< T > dijkstra(WeightedGraph< T > &g, int s)
{
    const auto INF = numeric_limits< T >::max();
    vector< T > dist(g.size(), INF);
    
    using Pi = pair< T, int >;
    priority_queue< Pi, vector< Pi >, greater< Pi > > que;
    dist[s] = 0;
    que.emplace(dist[s], s);
    while(!que.empty()) {
        T cost;
        int idx;
        tie(cost, idx) = que.top();
        que.pop();
        if(dist[idx] < cost) continue;
        for(auto &e : g[idx]) {
            auto next_cost = cost + e.cost;
            if(dist[e.to] <= next_cost) continue;
            dist[e.to] = next_cost;
            que.emplace(dist[e.to], e.to);
        }
    }
    return dist;
}

int main(){
    int n, m, s, t;
    cin >> n >> m >> s >> t;
    WeightedGraph<long> s_graph(n);
    WeightedGraph<long> t_graph(n);
    for(int i = 0; i < m; i++){
        int u, v, a, b;
        cin >> u >> v >> a >> b;
        s_graph[u - 1].push_back(edge<long>(v - 1, a));
        s_graph[v - 1].push_back(edge<long>(u - 1, a));
        t_graph[u - 1].push_back(edge<long>(v - 1, b));
        t_graph[v - 1].push_back(edge<long>(u - 1, b));
    }
    vector<long> s_distances = dijkstra(s_graph, s - 1);
    vector<long> t_distances = dijkstra(t_graph, t - 1);
    long ans[n];
    ans[n - 1] = s_distances[n - 1] + t_distances[n - 1];
    for(int i = n - 2; i >= 0; i--){
        ans[i] = min(s_distances[i] + t_distances[i], ans[i + 1]);
    }
    for(int i = 0; i < n; i++){
        cout << long(1e15) - ans[i] << endl;
    }
}


Measured memory_bytes: 19068