#include <bits/stdc++.h>

using namespace std;

#define countof(a) (sizeof(a)/sizeof(*a))

#define vi vector<int>
#define vvi vector<vector<int> >
#define vpi vector<pi >
#define pi pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define all(n) n.begin(), n.end()

#define FROMTO(var, from, to) for (register int var = (from), var##down = ((int)(to)) < ((int)(from));var##down ? (var >= (int)(to)) : (var <= (int)(to));var##down ? var-- : var++)
#define UPTO(var, from, to)   for (register int var = (from); var <= ((int)to); var++)
#define DOWNTO(var, from, to) for (register int var = (from); var >= ((int)to); var--)
#define FOR(var, to)          UPTO(var, 0, (to)-1)
#define DOWN(var, from)       DOWNTO(var, (from)-1, 0) 

#define INIT(var, val) FOR(i,countof(var)) var[i] = val
#define INPUT(var) FOR(i,countof(var)) cin >> var[i]
#define INPUT1(var) FOR(i,countof(var)) cin >> var[i], var[i]--

#define SORT(v) qsort(v,countof(v),sizeof(*v),int_less)
#define SORTT(v) qsort(v,countof(v),sizeof(*v),int_greater)
#define QSORT(v,b) qsort(v,countof(v),sizeof(*v),b)

#define MOD 1000000007
#define INF ((1 << 30)-1)
#define LINF ((1LL << 62)-1)

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;

struct Comb {
    vector<vector<s64> > data;
    Comb(int n) { // O(n^2)
        data = vector<vector<s64> >(n+1,vector<s64>(n+1,1));
        UPTO(i,1,n) {
            FOR(j,i+1) {
                if (!j || j == i) data[i][j] = 1;
                else data[i][j] = data[i-1][j-1] + data[i-1][j];
            }
        }
    }
    
    s64 ncr(int n, int r) {
        return data[n][r];
    }
};

static inline int ri() {
  int a;
  scanf("%d", &a);
  return a;
}

int int_less(const void *a, const void *b) {
  return (*((const int*)a) - *((const int*)b));
}
int int_greater(const void *a, const void *b) {
  return (*((const int*)b) - *((const int*)a));
}

struct Graph {
	int n;
	vector<vector<pair<int, s64> > > hen;
	
	// result of Bellman–Ford
	vector<vector<s64> > BF;
	set<int> bf_completed;
	
	Graph(int n) { // O(N)
		hen.resize(n, vector<pair<int, s64> >());
		BF.resize(n, vector<s64>());
		this->n = n;
	}
	
	int spfa(int k) {
		vector<bool> inque(n,false);
		vector<int> updated(n,0);
		
		bf_completed.insert(k);
		BF[k].resize(n,LINF);
		BF[k][k] = 0;
		
		queue<int> que;
		inque[k] = true;
		que.push(k);
		updated[k]++;
		while (que.size()) {
			int i = que.front(); que.pop();
			int n_hen = hen[i].size();
			FOR(j,n_hen) {
				if (BF[k][hen[i][j].fi] > BF[k][i] + hen[i][j].se) {
					BF[k][hen[i][j].fi] = BF[k][i] + hen[i][j].se;
					if (!inque[hen[i][j].fi]) {
						inque[hen[i][j].fi] = true;
						que.push(hen[i][j].fi);
					}
				}
			}
			inque[i] = false;
		}
		return -1;
	}
	
	s64 shortest(int from, int to) {
		return BF[from][to];
	}
	
	void add_hen(int from, int to, s64 cost, bool muki) {
		hen[from].push_back(mp(to, cost));
		if (!muki) hen[to].push_back(mp(from, cost));
	}
};
// Graph.dfs : O(N)
// Graph.dij : O(N+MlogM)
// Graph.bf  : O(NM)
// Graph.wf  : O(N^3)
// Graph.reachable
// Graph.shortest

int hen0_to[100000];
int hen0_cost[100000];
int hen0;
int hen1_to[100000];
int hen1_cost[100000];
int hen1;

int main() {
    int n = ri();
	int m = ri();
	int s = ri()-1;
	int t = ri()-1;
	Graph yen(n);
	Graph snuke(n);
	FOR(i,m) {
		int a = ri()-1;
		int b = ri()-1;
		yen.add_hen(a,b,ri(),false);
		snuke.add_hen(a,b,ri(),false);
	}
	yen.spfa(s);
	snuke.spfa(t);
	s64 cost[n];
	FOR(i,n) {
		cost[i] = yen.shortest(s,i) + snuke.shortest(t,i);
	}
	s64 mini[n];
	DOWN(i,n) {
		if (i == n-1) mini[i] = cost[i];
		else mini[i] = min(mini[i+1], cost[i]);
	}
	FOR(i,n) {
		cout << 1000000000000000LL-mini[i] << endl;
	}
    return 0;
}


Measured memory_bytes: 24704