import scala.collection.mutable.{ListBuffer, PriorityQueue}

object Main extends App {

  val init = 1e15.toLong

  val in = io.StdIn.readLine().split(' ')
  val (n, m, s, t) = (in(0).toInt, in(1).toInt, in(2).toInt - 1, in(3).toInt - 1)

  val g = Seq.fill(n)(ListBuffer[(Int, Long, Long)]())

  for (_ <- 1 to m) {
    val l = io.StdIn.readLine().split(' ')
    val (u, t, a, b) = (l(0).toInt - 1, l(1).toInt - 1, l(2).toLong, l(3).toLong)
    g(u) += ((t, a, b))
    g(t) += ((u, a, b))
  }

  val yenSeq = dijkstra(s, g, { case (_, a, _) => a })
  val snkSeq = dijkstra(t, g, { case (_, _, b) => b })
  val ans = Array.fill[Long](n + 1)(0L)

  Range(1, n + 1)
    .map(n - _)
    .foreach(idx => ans(idx) = math.max(ans(idx + 1), init - yenSeq(idx) - snkSeq(idx)))

  Range(0, n).foreach(idx => println(ans(idx)))

  def dijkstra(s: Int, g: Seq[Seq[(Int, Long, Long)]], f: ((Int, Long, Long)) => Long): Array[Long] = {
    val pq = new PriorityQueue[(Long, Int)]()(Ordering.by[(Long, Int), Long](-_._1))

    val score = Array.fill(n)(1L << 50)
    score(s) = 0
    pq.enqueue((0L, s))

    while (pq.nonEmpty) {
      val (c, p) = pq.dequeue
      if (score(p) == c) for (tup <- g(p)) {
        if (score(tup._1) > c + f(tup)) {
          score(tup._1) = c + f(tup)
          pq.enqueue((c + f(tup), tup._1))
        }
      }
    }
    score
  }
}
