local mmi, mma = math.min, math.max
local n, m = io.read("*n", "*n")
local s, t = io.read("*n", "*n")
local edge1, edge2 = {}, {}
for i = 1, n do
  edge1[i], edge2[i] = {}, {}
end
for i = 1, m do
  local u, v = io.read("*n", "*n")
  local a, b = io.read("*n", "*n")
  edge1[u][v] = a
  edge1[v][u] = a
  edge2[u][v] = b
  edge2[v][u] = b
end
local inf = 1000000000000000

local function getlength(start_idx, edge)
  local taskstate = {}
  for i = 1, n do taskstate[i] = false end
  local tasks = {}
  local tasknum = 0
  local done = 0

  local len = {}
  for i = 1, n do len[i] = inf end
  len[start_idx] = 0

  local function addtask(idx)
    if not taskstate[idx] then
      taskstate[idx] = true
      tasknum = tasknum + 1
      tasks[tasknum] = idx
    end
  end
  addtask(start_idx)

  while done < tasknum do
    done = done + 1
    local src = tasks[done]
    taskstate[src] = false
    for dst, cost in pairs(edge[src]) do
      if len[src] + cost < len[dst] then
        len[dst] = len[src] + cost
        addtask(dst)
      end
    end
  end
  return len
end

local len1 = getlength(s, edge1)
local len2 = getlength(t, edge2)
local ret = {}
for i = 1, n do
  ret[i] = 0
end
local z = 0
for i = n, 1, -1 do
  z = mma(z, inf - len1[i] - len2[i])
  ret[i] = z
end
print(table.concat(ret, "\n"))
