#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int n,m,s,t;
#include<vector>
#include<queue>
#include<limits>
template<typename T>
vector<T>dijkstra(int s,const vector<vector<pair<int,T> > >&G,T INF=numeric_limits<T>::max())
{
	int n=G.size();
	vector<T>d(n,INF);
	vector<int>parent(n,-1);
	priority_queue<pair<T,int>,vector<pair<T,int> >,greater<pair<T,int> > >P;
	d[s]=0;
	P.push(make_pair(d[s],s));
	while(!P.empty())
	{
		pair<T,int>p=P.top();P.pop();
		int v=p.second;
		if(d[v]<p.first)continue;
		for(const pair<int,T>&e:G[v])
		{
			int u=e.first;
			T cost=d[v]+e.second;
			if(d[u]>cost)
			{
				d[u]=cost;
				parent[u]=v;
				P.push(make_pair(d[u],u));
			}
		}
	}
	return d;
}
int main()
{
	cin>>n>>m>>s>>t;
	s--,t--;
	vector<vector<pair<int,long> > >G(n),H(n);
	for(int i=0;i<m;i++)
	{
		int u,v,a,b;cin>>u>>v>>a>>b;u--,v--;
		G[u].push_back(make_pair(v,a));
		G[v].push_back(make_pair(u,a));
		H[u].push_back(make_pair(v,b));
		H[v].push_back(make_pair(u,b));
	}
	vector<long>ds=dijkstra(s,G);
	vector<long>dt=dijkstra(t,H);
	long ans=1e18;
	vector<long>s;
	for(int i=n;i--;)
	{
		ans=min(ans,ds[i]+dt[i]);
		s.push_back(1e15-ans);
	}
	for(int i=n;i--;)cout<<s[i]<<endl;
}
