#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>

long long mod = 1e9+7;
class Mint {
public:
  long long x;
  Mint(){}; // 引数なしでも定義できるように引数なしコンストラクタも用意しておく
  Mint(long long a){
    x = a%mod;
    while(x<0){
      x += mod;
    }
  };
  Mint& operator += (const Mint &a){
    x+=a.x;
    x%=mod;
    return *this;
  }
  Mint& operator -= (const Mint &a){
    x += (mod - a.x);
    x%=mod;
    return *this;
  }
  Mint& operator *= (const Mint &a){
    x*=a.x;
    x%=mod;
    return *this;
  }

  // a^n mod を計算する
  // Useaeg: Mint z = y.pow(y, n);
  Mint pow(Mint a, long long n) const {
    Mint y(1);
    Mint b(a);
    while (n > 0) {
      if (n & 1) y *= b;
      b *= b;
      n >>= 1;
    }
    return y;
  }

  // a^{-1} mod を計算する
  Mint modinv(const Mint &a) const {
    return pow(a, mod-2);
  }

  Mint& operator /= (const Mint &a) {
    x *= modinv(a).x;
    x %= mod;
    return *this;
  }

  Mint operator + (Mint &a) const {
    Mint y(*this);
    y += a;
    return y;
  }

  Mint operator - (Mint &a) const {
    Mint y(*this);
    y -= a;
    return y;
  }

  Mint operator * (Mint &a) const {
    Mint y(*this);
    y *= a;
    return y;
  }

  Mint operator / (Mint &a) const {
    Mint y(*this);
    y/=a;
    return y.x;
  }

  // nCk @mod を計算する
  Mint nCk(Mint &n, const long long k) const {
    Mint y = Mint(1);
    for (Mint i(0); (i.x)<k; i.x++){
      y *= (n-i);
      y /= i;
    }
    return y;
  }

  // nPk @mod を計算する
  Mint nPk(Mint &n, long long k) const {
    Mint y(1);
    for (Mint i(0); (i.x)<k; i.x++){
      y *= (n-i);
    }
    return y;
  }
};

int main(){
  int n, m, s, t;
  std::cin >> n >> m >> s >> t;
  s--;
  t--;
  std::vector<std::pair<int, long long > > yen[100004], snook[100004];
  int u, v;
  long long a, b;
  for (int i=0; i<m; i++) {
    std::cin >> u >> v >> a >> b;
    u--;
    v--;
    yen[u].push_back(std::make_pair(v, a));
    yen[v].push_back(std::make_pair(u, a));
    snook[u].push_back(std::make_pair(v, b));
    snook[v].push_back(std::make_pair(u, b));
  }
  std::priority_queue<std::pair<long long, int >, std::vector<std::pair<long long, int >>, std::greater<std::pair<long long, int >> > queue;
  queue.push(std::make_pair(0, s));
  std::vector<long long > dist_yen(n, 1e18);
  dist_yen[s] = 0;
  while(queue.size()>0) {
    int v = queue.top().second;
    long long d = queue.top().first;
    queue.pop();
    if (dist_yen[v] < d) continue;
    for (auto &entry : yen[v]) {
      int vv = entry.first;
      long long dd = entry.second;
      if (dist_yen[vv]==(long long)1e18 || dist_yen[vv]>d+dd) {
        dist_yen[vv] = d+dd;
        //printf("dist_yen[%d]=%lld\n", vv, d+dd);
        queue.push(std::make_pair(d+dd, vv));
      }
    }
  }

  queue.push(std::make_pair(0, t));
  std::vector<long long > dist_snook(n, 1e18);
  dist_snook[t] = 0;
  while(queue.size()>0) {
    int v = queue.top().second;
    long long d = queue.top().first;
    queue.pop();
    if (dist_snook[v]<d) continue;
    for (auto &entry : snook[v]) {
      int vv = entry.first;
      long long dd = entry.second;
      if (dist_snook[vv]==(long long )1e18 || dist_snook[vv]>d+dd) {
        dist_snook[vv] = d + dd;
        queue.push(std::make_pair(d+dd, vv));
      }
    }
  }
  for (int i=0; i<n; i++) {
    //printf("s->%d(yen)=%lld, %d->t(snook)=%lld\n", i, dist_yen[i], i, dist_snook[i]);
    queue.push(std::make_pair(dist_yen[i] + dist_snook[i], i));
  }
  for (int i=0; i<n; i++) {
    int minv = queue.top().second;
    long long mind = queue.top().first;
    while(minv<i) {
      queue.pop();
      minv=queue.top().second;
      mind = queue.top().first;
    }
    //printf("minv=%d\n", minv);
    std::cout << (long long)1e15 - mind << std::endl;

  }
  return 0;
}

Measured memory_bytes: 21396