/*
memo for solution
*/
#include <cstdlib> 
#include <numeric>
#include <cstring>
#include <cstdio> 
#include <cfloat> 
#include <map> 
#include <cassert>
#include <cmath> 
#include <climits> 
#include <utility> 
#include <set> 
#include <iostream> 
#include <memory> 
#include <string> 
#include <vector> 
#include <algorithm> 
#include <functional> 
#include <sstream> 
#include <complex> 
#include <stack> 
#include <queue> 
#include <iomanip>
#include<sys/time.h>
using namespace std; 
double e_time(void){static struct timeval now;gettimeofday(&now, NULL);return (double)(now.tv_sec  + now.tv_usec/1000000.0);}
#define REP(i,b,n) for(int i=b;i<n;i++) 
#define rep(i,n)      REP(i,0,n) 
#define pb push_back  
#define mp make_pair 
#define ALL(C)   (C).begin(),(C).end() 
#define fe(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr != (c).end();itr++)
#define BITSHIFT(X)     ( (1<<(X)) )
#define CONTAIN(S,X) ( ((S)&BITSHIFT(X)) != 0)
typedef complex<double>P; 
typedef long long ll; 
typedef unsigned long long ull; 
typedef pair<int,int> pii; 
typedef vector<int> vint;
template<class T> void vp(T &a,int p){rep(i,p)cout << a[i]<<" ";cout << endl;}  
template<class T> T ceilUp(const T& a,const T& b){return (a+b-1)/b;}
const ll mod =   1000000009;
inline ll modadd(ll a,ll b){a %= mod;b %= mod;return (a+b)%mod;}
inline ll modsub(ll a,ll b){a %= mod;b %= mod;a-=b;a%=mod;if (a<0)a+=mod;return a;}
inline ll modmul(ll a,ll b){a %= mod;b %= mod;return (a*b)%mod;}
inline ll modeq(ll a,ll b,ll m){a = (a%m+m)%m; b = (b%m+m)%m;return a == b;}
//ll modpow(ll n,ll p){if (p == 0)return 1;if (p == 1)return n;ll ret=mypow(n,p/2);ret=ret*ret%mod;if (p&1)ret=ret*n%mod;return ret;}
//ll getinv(ll a){return mypow(a,mod-2);}


const ll inf = (1LL << 60);

class State{
public:
  int now;
  ll cost;
  bool operator>(const State a)const;
};

bool State::operator>(const State a)const{
  return cost > a.cost;
}

typedef struct{
  int to;
  int cost;
} Edge;

void dijkstra(int n, int s, ll cost[], vector<Edge> edge[]){
  fill(cost, cost+n, inf);
  cost[s] = 0;
  priority_queue<State, vector<State>, greater<State> > pq;
  //priority_queue<State> pq;
  pq.push({s, 0});
  while(!pq.empty()){
    State now = pq.top();pq.pop();
    if (cost[now.now] != now.cost)continue;
    for(int i = 0;i < edge[now.now].size();i++){
      State next={edge[now.now][i].to, now.cost + edge[now.now][i].cost};
      if (cost[next.now] <= next.cost)continue;
      cost[next.now] = next.cost;
      pq.push(next);
    }
  }
}

const int N = 100000;
ll costY[N];
ll costS[N];
ll maxi[N];
vector<Edge> ey[N];
vector<Edge> es[N];

void solve(int n, int s, int t, vector<Edge>  eY[], vector<Edge>  eS[]){
  dijkstra(n, s, costY, eY);

  dijkstra(n, t, costS, eS);

  const ll init = 1e15;
  /*
  for(int i = 0;i < n;i++){
    cost[i] = (init - costY[i]) - costS[i];
  }

  maxi[n-1] = cost[n-1];
  for(int i = n-2;i >= 0;i--){
    maxi[i] = max(maxi[i+1], cost[i]);
  }
  */
  maxi[n-1] = (init - costY[n-1]) - costS[n-1];
  for(int i = n-2;i >= 0;i--){
    maxi[i] = max(maxi[i+1], (init - costY[i]) - costS[i]);
  }

  for(int i = 0;i < n;i++){
    printf("%lld\n", maxi[i]);
  }
}


int main(){
  int n, m, s, t;
  //cin >> n >> m >> s >> t;
  scanf("%d%d%d%d", &n, &m, &s, &t);
  s--;t--;
  //vector<
  //vector<vector<Edge> > ey(n);
  //vector<vector<Edge> > es(n);
  for(int i = 0;i < m;i++){
    int from, to;
    int yen, snuke;
    //cin >> from >> to >> yen >> snuke;
    scanf("%d%d%d%d", &from, &to, &yen, &snuke);
    from--;
    to--;
    Edge tmpY = {to, yen};
    ey[from].emplace_back(tmpY);

    tmpY.to = from;
    ey[to].emplace_back(tmpY);

    Edge tmpS = {to, snuke};
    es[from].emplace_back(tmpS);

    tmpS.to = from;
    es[to].emplace_back(tmpS);
  }
  solve(n, s, t, ey, es);
  return 0;
}


Measured memory_bytes: 16252