#include <bits/stdc++.h>
    #include <chrono>
    using namespace std;
    typedef long long ll;
    #define tr(container, it) \
        for (auto it = container.begin(); it != container.end(); it++)
    #define scontains(c, x) ((c).find(x) != (c).end())   //O(log n)
    #define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
    #define ill(_x)  ll _x;scanf("%lld",&_x);
    #define idb(_x)  double _x;scanf("%lf",&_x);
    #define all(x) (x).begin(),(x).end()
    #define pll pair<ll,ll>
    #define mll map<ll,ll>
    #define vll vector<ll>
    #define sll set<ll>
    #define vs vector<string>
    #define in0(x, a, b)((x)>=a && (x)<=b    )
    #define in1(x, a, b)((x)>a && (x)<b)
    #define  rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
    const double pi = 3.14159265358979323846;
    const int INF = 0x3f3f3f3f;
    const int X10=1024,X11=2048,X12=4096,X13=8196,X14=16392,X15=32786,X16=65536,X17=131072,X18=262144,X19=524288,X20=1048576;

    class wGraph
{
	ll V;
	vector<pair<ll, ll>> *adj;

public:
	wGraph(ll V);
	void addEdge(ll u, ll v, ll w);
	void addEdgeDirected(ll u, ll v, ll w);
	void BFS(ll s);
	void DFS(ll s);
	void DFSs(ll s, bool[]);
	vector<ll> Dijkstra(ll source);
	vector<ll> Bellman(ll source);
};
void wGraph::addEdge(ll u, ll v, ll w)
{
	adj[u].push_back(make_pair(v, w));
	adj[v].push_back(make_pair(u, w));  //Undirected
}

void wGraph::addEdgeDirected(ll u, ll v, ll w)
{
	adj[u].push_back(make_pair(v, w));
}

wGraph::wGraph(ll V)
{
	this->V = V;
	adj = new vector<pair<ll, ll>>[V];
}

void wGraph::BFS(ll s)
{
	// Mark all the vertices as not visited
	bool *visited = new bool[V];
	for (ll i = 0; i < V; i++)
		visited[i] = false;

	// Create a queue for BFS
	queue<ll> queue;
	visited[s] = true;
	queue.push(s);

	while (!queue.empty())
	{
		// Dequeue a vertex from queue and prll it
		s = queue.front();
		cout << s << "\n";
		queue.pop();
		std::cout << "visiting" << s << "\n";
		for (auto i = adj[s].begin(); i != adj[s].end(); ++i)
		{
			if (!visited[i->first])
			{
				visited[i->first] = true;
				queue.push(i->first);
			}
		}
	}
}

void wGraph::DFS(ll s)
{
	bool* visited = new bool[V];
	for (ll i = 0; i < V; ++i)
	{
		visited[i] = false;
	}
	DFSs(s, visited);
}
void wGraph::DFSs(ll s, bool visited[])
{
	visited[s] = true;
	cout << s << " ";

	for (auto i = adj[s].begin(); i != adj[s].end(); ++i)
	{
		if (!visited[i->first])
		{
			visited[i->first] = true;
			DFSs(i->first, visited);
		}
	}
}

vector<ll> wGraph::Dijkstra(ll source)
{
	vector<ll> Dist;
	priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>> > Q;   // min heap
																						  //	priority_queue<pair<ll,ll>, vector<pair<ll, ll>> > Q;   // correct but slow
																						  //	stack<pair<ll,ll> > Q;   //  correct but slow

	Dist.assign(V, LLONG_MAX);
	Dist[source] = 0;
	Q.push({ 0,source });
	while (!Q.empty()) {
		ll u = Q.top().second;
		Q.pop();
		for (auto &c : adj[u]) {
			ll v = c.first;
			ll w = c.second;
			if (Dist[v] > Dist[u] + w) {
				Dist[v] = Dist[u] + w;
				Q.push({ Dist[v],v });
			}
		}
	}
	return Dist;
}

vector<ll> wGraph::Bellman(ll source)
{
	vector<ll> Dist;
	Dist.assign(V, LLONG_MAX);
	Dist[source] = 0;
	for (ll i = 0; i < V; ++i)
	{
		for (ll u = 0; u < V; ++u)
		{
			for (auto &c : adj[u]) {
				ll v = c.first;
				ll w = c.second;
				if (Dist[v] > Dist[u] + w)Dist[v] = Dist[u] + w;
			}
		}
	}

	for (ll u = 0; u < V; ++u)
	{
		for (auto &c : adj[u]) {
			ll v = c.first;
			ll w = c.second;
			//			assert(Dist[v] > Dist[u] + w);
			if (Dist[v] > Dist[u] + w)
			{
				//				cerr << "Graph contains a negative-weight cycle";
				return vector<ll>(0);
			}
		}
	}
	return Dist;
}


class Graph
{
	ll V;    // No. of vertices

			  // Poller to an array containing adjacency
			  // lists
	vector<ll> *adj;
public:
	Graph(ll V);  // Constructor

				   // function to add an edge to graph
	void addEdge(ll v, ll w);
	void addEdgeDirected(ll v, ll w);

	// prlls BFS traversal from a given source s
	void BFS(ll s);
	void DFS(ll s);
	void DFSs(ll s, bool[]);
};

Graph::Graph(ll V)
{
	this->V = V;
	adj = new vector<ll>[V];
}

void Graph::addEdge(ll v, ll w)
{
	adj[v].push_back(w);
	adj[w].push_back(v); // Undirected
}

void Graph::addEdgeDirected(ll v, ll w)
{
	adj[v].push_back(w);
	//	adj[w].push_back(v); // Undirected
}

void Graph::BFS(ll s)
{
	// Mark all the vertices as not visited
	bool *visited = new bool[V];
	for (ll i = 0; i < V; i++)
		visited[i] = false;

	// Create a queue for BFS
	queue<ll> queue;
	visited[s] = true;
	queue.push(s);

	while (!queue.empty())
	{
		// Dequeue a vertex from queue and prll it
		s = queue.front();
		cout << s << "\n";
		queue.pop();
		std::cout << "visiting" << s << "\n";
		for (auto i = adj[s].begin(); i != adj[s].end(); ++i)
		{
			if (!visited[*i])
			{
				visited[*i] = true;
				queue.push(*i);
			}
		}
	}
}

void Graph::DFS(ll s)
{
	bool* visited = new bool[V];
	for (ll i = 0; i < V; ++i)
	{
		visited[i] = false;
	}
	DFSs(s, visited);
}
void Graph::DFSs(ll s, bool visited[])
{
	visited[s] = true;
	cout << s << " ";

	for (auto i = adj[s].begin(); i != adj[s].end(); ++i)
	{
		if (!visited[*i])
		{
			visited[*i] = true;
			DFSs(*i, visited);
		}
	}
}

    void _ (){
        ll n,m,s,t;
        ll u,v,a,b;
        cin >> n >> m >> s >>t;
        wGraph g1(n);
        wGraph g2(n);
        for (ll i = 0; i < m; ++i) {
            cin >> u >> v >> a >>b;
            g1.addEdge(u-1,v-1,a);
            g2.addEdge(u-1,v-1,b);
        }

        vector<ll> v1=g1.Dijkstra(s-1);
        vector<ll> v2=g2.Dijkstra(t-1);
        vector<ll> v3(n);
        ll mi =LLONG_MAX;
        for (ll i = n-1; i >=0; --i) {
            mi=min(mi,v1[i]+v2[i]);
            v3[i]=mi;
        }

        for (int i = 0; i < n; ++i) {
            cout << (ll)1e15-v3[i] <<"\n";
        }





    }





    int main() {
    #ifdef Debug
        freopen("/home/joduskame/Desktop/cpp/IO/Input.txt", "r", stdin);
        freopen("/home/joduskame/Desktop/cpp/IO/Output.txt", "w", stdout);
    #endif
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        _();
        return 0;

    }








Measured memory_bytes: 19016