#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>

using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 8080
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD=1e9+7;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
ll d[114514],d_sn[114514];
int n;
vector<pill> graph[114514];
vector<pill> graph_sn[114514];
void dijkstra(int start){
	priority_queue<plli, vector<plli>,greater<plli> > que;
	for(int i=0;i<n;i++)d[i]=INF;
	d[start] = 0;
	que.push( mp(0,start) );//cost,ver
	
	while(!que.empty()){
		plli p=que.top();
		que.pop();
		
		int v=p.second;
		if(d[v]<p.first)continue;
		
		for(int i=0;i<graph[v].size();i++){
			pill e=graph[v][i];//graphはver,cost
			if(d[e.first]>d[v]+e.second){
				d[e.first]=d[v]+e.second;
				que.push(mp(d[e.first],e.first));
			}
		}
	}
	
}

void dijkstra_sn(int start){
	priority_queue<plli, vector<plli>,greater<plli> > que;
	for(int i=0;i<n;i++)d_sn[i]=INF;
	d_sn[start] = 0;
	que.push( mp(0,start) );//cost,ver
	
	while(!que.empty()){
		plli p=que.top();
		que.pop();
		
		int v=p.second;
		if(d_sn[v]<p.first)continue;
		
		for(int i=0;i<graph_sn[v].size();i++){
			pill e=graph_sn[v][i];//graphはver,cost
			if(d_sn[e.first]>d_sn[v]+e.second){
				d_sn[e.first]=d_sn[v]+e.second;
				que.push(mp(d_sn[e.first],e.first));
			}
		}
	}
	
}

int main(){
	int m,s,t;
	cin>>n>>m>>s>>t;s--;t--;
	for(int i=0;i<m;i++){
		int u,v;
		ll a,b;
		cin>>u>>v>>a>>b;u--;v--;
		graph[u].pb(mp(v,a));
		graph[v].pb(mp(u,a));
		graph_sn[u].pb(mp(v,b));
		graph_sn[v].pb(mp(u,b));
	}
	dijkstra(s);
	/*	for(int i=0;i<n;i++){
		cout<<d[i]<<" ";
	}
	cout<<endl;*/
	dijkstra_sn(t);
	/*or(int i=0;i<n;i++){
		cout<<d_sn[i]<<" ";
	}
	cout<<endl;*/
	vector<plli> data;
	for(int i=0;i<n;i++){
		data.pb(mp(1e15-d[i]-d_sn[i],i+1));
	}
	sort(data.begin(),data.end());
	reverse(data.begin(),data.end());
	int now = 0;
	for(int i=0;i<n;i++){
		while(data[now].second<=i)now++;
		cout<<data[now].first<<endl;
	}
}

Measured memory_bytes: 20788