#include<bits/stdc++.h>
using namespace std;
void *wmem;
void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
void wt_L(long long x){
  char f[20];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class S, class T> inline S chmax(S &a, T b){
  if(a<b){
    a=b;
  }
  return a;
}
template <class T> struct DijkstraHeap{
  T *val;
  char *visited;
  int *hp, *place, size;
  void malloc(int N){
    hp = (int*)std::malloc(N*sizeof(int));
    place = (int*)std::malloc(N*sizeof(int));
    visited = (char*)std::malloc(N*sizeof(char));
    val = (T*)std::malloc(N*sizeof(T));
  }
  void free(){
    std::free(hp);
    std::free(place);
    std::free(visited);
    std::free(val);
  }
  void walloc(int N, void **mem=&wmem){
    hp = (int*)(*mem);
    place = hp + N;
    visited = (char*)(place+N);
    val = (T*)(visited+N);
    *mem = val + N;
  }
  void init(int N){
    int i;
    size = 0;
    for(i=0;i<N;i++){
      place[i]=-1;
    }
    for(i=0;i<N;i++){
      visited[i]=0;
    }
  }
  void up(int n){
    int m;
    while(n){
      m=(n-1)/2;
      if(val[hp[m]]<=val[hp[n]]){
        break;
      }
      swap(hp[m],hp[n]);
      swap(place[hp[m]],place[hp[n]]);
      n=m;
    }
  }
  void down(int n){
    int m;
    for(;;){
      m=2*n+1;
      if(m>=size){
        break;
      }
      if(m+1<size&&val[hp[m]]>val[hp[m+1]]){
        m++;
      }
      if(val[hp[m]]>=val[hp[n]]){
        break;
      }
      swap(hp[m],hp[n]);
      swap(place[hp[m]],place[hp[n]]);
      n=m;
    }
  }
  void change(int n, T v){
    if(visited[n]||(place[n]>=0&&val[n]<=v)){
      return;
    }
    val[n]=v;
    if(place[n]==-1){
      place[n]=size;
      hp[size++]=n;
      up(place[n]);
    }
    else{
      up(place[n]);
    }
  }
  int pop(void){
    int res=hp[0];
    place[res]=-1;
    size--;
    if(size){
      hp[0]=hp[size];
      place[hp[0]]=0;
      down(0);
    }
    visited[res]=1;
    return res;
  }
}
;
char memarr[96000000];
int A[100000], B[100000], C[100000], D[100000], M, N, S, T;
long long dist1[100000], dist2[100000], res[100000];
vector<int> cost1[100000], cost2[100000], edge[100000];
int main(){
  DijkstraHeap<long long> hp;
  int i, j, k, m;
  long long c;
  wmem = memarr;
  rd(N);
  rd(M);
  rd(S);
  rd(T);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<M;Lj4PdHRW++){
      rd(A[Lj4PdHRW]);
      rd(B[Lj4PdHRW]);
      rd(C[Lj4PdHRW]);
      rd(D[Lj4PdHRW]);
    }
  }
  S--;
  T--;
  for(i=0;i<M;i++){
    A[i]--;
    B[i]--;
  }
  for(k=0;k<M;k++){
    i = A[k];
    j = B[k];
    edge[i].push_back(j);
    edge[j].push_back(i);
    cost1[i].push_back(C[k]);
    cost1[j].push_back(C[k]);
    cost2[i].push_back(D[k]);
    cost2[j].push_back(D[k]);
  }
  hp.walloc(N);
  hp.init(N);
  hp.change(S,0);
  while(hp.size){
    i = hp.pop();
    c = hp.val[i];
    for(k=0;k<edge[i].size();k++){
      j = edge[i][k];
      hp.change(j,c+cost1[i][k]);
    }
  }
  for(i=0;i<N;i++){
    dist1[i] = hp.val[i];
  }
  hp.init(N);
  hp.change(T,0);
  while(hp.size){
    i = hp.pop();
    c = hp.val[i];
    for(k=0;k<edge[i].size();k++){
      j = edge[i][k];
      hp.change(j,c+cost2[i][k]);
    }
  }
  for(i=0;i<N;i++){
    dist2[i] = hp.val[i];
  }
  for(i=0;i<N;i++){
    res[i] = 1000000000000000LL - dist1[i] - dist2[i];
  }
  for(i=N-2;i>=0;i--){
    chmax(res[i], res[i+1]);
  }
  for(i=0;i<N;i++){
    wt_L(res[i]);
    putchar_unlocked('\n');
  }
  return 0;
}
// cLay varsion 20180707-1 [beta]

// --- original code ---
// int N, M, S, T;
// int A[1d5], B[1d5], C[1d5], D[1d5];
// 
// vector<int> edge[1d5], cost1[1d5], cost2[1d5];
// 
// ll dist1[1d5], dist2[1d5];
// ll res[1d5];
// {
//   int i, j, k, m;
//   ll c;
//   DijkstraHeap<ll> hp;
//   
//   rd(N,M,S,T);
//   rd((A,B,C,D)(M));
// 
//   S--; T--;
//   rep(i,M) A[i]--, B[i]--;
// 
//   rep(k,M){
//     i = A[k];
//     j = B[k];
//     edge[i].push_back(j);
//     edge[j].push_back(i);
//     cost1[i].push_back(C[k]);
//     cost1[j].push_back(C[k]);
//     cost2[i].push_back(D[k]);
//     cost2[j].push_back(D[k]);
//   }
// 
//   hp.walloc(N);
// 
//   hp.init(N);
//   hp.change(S,0);
//   while(hp.size){
//     i = hp.pop();
//     c = hp.val[i];
//     rep(k,edge[i].size()){
//       j = edge[i][k];
//       hp.change(j,c+cost1[i][k]);
//     }
//   }
//   rep(i,N) dist1[i] = hp.val[i];
// 
//   hp.init(N);
//   hp.change(T,0);
//   while(hp.size){
//     i = hp.pop();
//     c = hp.val[i];
//     rep(k,edge[i].size()){
//       j = edge[i][k];
//       hp.change(j,c+cost2[i][k]);
//     }
//   }
//   rep(i,N) dist2[i] = hp.val[i];
// 
//   rep(i,N) res[i] = 1d15 - dist1[i] - dist2[i];
//   for(i=N-2;i>=0;i--) res[i] >?= res[i+1];
// 
//   rep(i,N) wt(res[i]);
// }


Measured memory_bytes: 25600