#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>
#include<map>

using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
using P=pair<int,int>;
using lint=long long;
using ll=long long;
const lint inf=1e18+7;
const int MOD=1000000007;
struct Node{
  int no;//number of node
  int col;//color of binary_graph
  long long dist;//distance of arbitrary node
  int rdist;
  int group;//group number of disconnected graph
  int indegree;//indegree of this node
  vector<pair<Node*,P>> child;//chidren of this node
  vector<pair<Node*,long long>> par;//parretns of this node
  void build(int i){
    no=i;col=0;dist=inf;
    group=0;indegree=0;rdist=inf;
  }
};
bool operator >(const Node &a,const Node &r){
        return a.dist > r.dist;
    }
struct Graph{
    int n;
    bool direct;
    vector<Node> node;
    Graph(int N){
        n=N;
        node.resize(n+1);
        for(int i=1;i<=n;++i){
            node[i].build(i);
        }
    }
    void input(int m,bool flag){
        //choose direct or undirect
        direct=flag;
        for(int i=0;i<m;++i){
            P l;
            int a,b;cin>>a>>b>>l.first>>l.second;
            node[a].child.push_back({&node[b],l});
            if(!direct){
                node[b].child.push_back({&node[a],l});
            }
        }
    }
    void dijkstra(int s){
        for(int i=1;i<=n;++i){
            node[i].dist=inf;
        }
        node[s].dist=0;
        priority_queue<Node,vector<Node>,greater<Node>> que;
        que.push(node[s]);
        while(!que.empty()){
            Node buf=que.top();que.pop();
            int num=buf.child.size();
            for(int i=0;i<num;++i){
                if(buf.child[i].first->dist>buf.child[i].second.first+buf.dist){
                    buf.child[i].first->dist=buf.child[i].second.first+buf.dist;
                    que.push(*buf.child[i].first);
                }
            }
        }
    }
    void dijkstra2(int s){
        for(int i=1;i<=n;++i){
            node[i].dist=inf;
        }
        node[s].dist=0;
        priority_queue<Node,vector<Node>,greater<Node>> que;
        que.push(node[s]);
        while(!que.empty()){
            Node buf=que.top();que.pop();
            int num=buf.child.size();
            for(int i=0;i<num;++i){
                if(buf.child[i].first->dist>buf.child[i].second.second+buf.dist){
                    buf.child[i].first->dist=buf.child[i].second.second+buf.dist;
                    que.push(*buf.child[i].first);
                }
            }
        }
    }
    void solve(int s,int t){
      dijkstra(s);
      vector<int> d(n+1,0);
      rep1(i,n){
        d[i]=node[i].dist;
        node[i].dist=inf;
      }
      dijkstra2(t);
      vector<int> res(n+5,0);
      for(int i=n;i>0;--i){
        int buf=1e15-d[i]-node[i].dist;
        res[i]=max(res[i+1],buf);
        //cout<<res[i]<<"\n";
      }
      for(int i=1;i<=n;++i){
        cout<<res[i]<<"\n";
      }
    }
    
};

signed main(){
  int n,m,s,t;cin>>n>>m>>s>>t;
  Graph g(n);
  g.input(m,false);
  g.solve(s,t);
  return 0;
}


Measured memory_bytes: 26892