function Main(s){
  s = s.split("\n");
  var n = s[0].split(" ").map(a=>+a);
  var m = n[1];
  var q = n[2] - 1;
  var t = n[3] - 1;
  n = n[0];
  var u = [], v = [], a = [], b = [];
  for(var i = 0; i < m; i++){
    var z = s[i+1].split(" ").map(a=>+a);
    u[i] = z[0] - 1; v[i] = z[1] - 1; a[i] = z[2]; b[i] = z[3];
  }
  var c = dijkstra(u,v,a,q,n);
  var d = dijkstra(u,v,b,t,n);
  var e = [];
  i = n - 1;
  e[i] = c[i] + d[i];
  for(;i--;)e[i] = Math.min(e[i+1], c[i] + d[i]);
  console.log(e.map(a=>1e15-a).join("\n"));
}
function dijkstra(a,b,c,s,k){
  var t = Array(k).fill(0).map(a=>Array());
  for(var i = 0; i < a.length; i++)t[a[i]][b[i]] = t[b[i]][a[i]] = c[i];
  var r = Array(k).fill(9e99); r[s] = 0;
  var m = 9e999, n, p = {};
  for(i in t[s]){
    p[i] = 1;
    r[i] = t[s][i];
    if(m > r[i]){m = r[i]; n = i;}
  }
  while(Object.keys(p).length){
    m = 9e999;
    for(i in p)if(m > r[i]){m = r[i]; n = i;}
    delete p[n];
    for(i in t[n]){
      if(r[i] <= r[n] + t[n][i])continue;
      p[i] = 1;
      r[i] = r[n] + t[n][i];
    }
  }
  return r;
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));