
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)]())

  (1 to m).map(_ => io.StdIn.readLine().split(' '))
    .map(in => (in(0).toInt - 1, in(1).toInt - 1, in(2).toLong, in(3).toLong))
    .foreach { case (u, t, a, b) =>
      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)]()

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

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