#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> pii;

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = (int)1e5 + 9;
const ll inf = (ll)1e15;
vector<pii> T[2][N];

ll d[2][N];
ll ans[N];

int n;
void dij(int node, int q){
  for(int i = 1; i <= n; i ++ ){
    d[q][i] = inf;
  }
  d[q][node] = 0;
  priority_queue<pii,vector<pii>, greater<pii>> ff;
  ff.push(mp(0,node));
  ll dis;
  while(!ff.empty()){
    node = ff.top().se;
    dis = ff.top().fi;
    ff.pop();
    if(dis != d[q][node]) continue;
    for(auto x : T[q][node]){
      if(d[q][node] + x.se < d[q][x.fi]){
        d[q][x.fi] = d[q][node] + x.se;
        ff.push(mp(d[q][x.fi], x.fi));
      }
    }
  }
}

int main(){
  fastIO;
  int m, s, t;
  cin >> n >> m >> s >> t;
  int u, v;
  ll a, b;
  for(int i = 0 ; i < m ; i ++ ){
    cin >> u >> v >> a >> b;
    T[0][u].push_back(mp(v,a));
    T[0][v].push_back(mp(u,a));
    T[1][u].push_back(mp(v,b));
    T[1][v].push_back(mp(u,b));
  }
  dij(s,0);
  dij(t,1);
  for(int i = n; i >= 1; i -- ){
    ans[i] = inf - d[0][i] - d[1][i];
    ans[i] = max(ans[i], ans[i + 1]);
  }
  for(int i = 1; i <= n; i ++ ){
    cout << ans[i] << "\n";
  }
  return 0;
}