use std::io::{BufRead, BufWriter, Write};

fn main() {
    let stdin = std::io::stdin();
    let vals = stdin.lock().gets().split(' ').map(|x| x.parse().unwrap())
        .collect::<Vec<usize>>();
    let (n, m, s, t) = (vals[0], vals[1], vals[2] - 1, vals[3] - 1);
    let mut yedges = vec![Vec::new(); n];
    let mut sedges = vec![Vec::new(); n];
    for line in stdin.lock().lines().take(m).map(|x| x.unwrap()) {
        let mut it = line.split(' ').map(|x| x.parse::<usize>().unwrap());
        let (n1, n2) = (it.next().unwrap() - 1, it.next().unwrap() - 1);
        let (yen, snk) = (it.next().unwrap() as u64, it.next().unwrap() as u64);
        yedges[n1].push((n2, yen));
        yedges[n2].push((n1, yen));
        sedges[n1].push((n2, snk));
        sedges[n2].push((n1, snk));
    }
    let mut fare = vec![0; n];
    let mut d = Dijkstra::new(n, yedges, s);
    while let Some((n, c)) = d.next() {
        fare[n] = c;
    }
    let mut d = Dijkstra::new(n, sedges, t);
    while let Some((n, c)) = d.next() {
        fare[n] += c;
    }
    let mut min = std::u64::MAX;
    let mut ans = Vec::new();
    for f in fare.into_iter().rev() {
        min = std::cmp::min(min, f);
        ans.push(1_000_000_000_000_000 - min);
    }
    let stdout = std::io::stdout();
    let mut stdout = BufWriter::new(stdout.lock());
    for x in ans.into_iter().rev() {
        writeln!(stdout, "{}", x).unwrap();
    }
}

struct Dijkstra {
    edges: Vec<Vec<(usize, u64)>>,
    queue: BinHeap,
}

struct BinHeap {
    cost: Vec<u64>,
    heap: Vec<usize>,
    index: Vec<usize>,
}

impl Dijkstra {
    pub fn new(size: usize, edges: Vec<Vec<(usize, u64)>>, s: usize) -> Self {
        let mut queue = BinHeap::new(size);
        queue.set_lower_cost(s, 0);
        Dijkstra { edges: edges, queue: queue }
    }

    fn next(&mut self) -> Option<(usize, u64)> {
        self.queue.pop().map(|v| {
            for &(n, d) in &self.edges[v] {
                let c = self.queue.cost[v] + d;
                if c < self.queue.cost[n] {
                    self.queue.set_lower_cost(n, c);
                }
            }
            (v, self.queue.cost[v])
        })
    }
}

impl BinHeap {
    fn new(size: usize) -> Self {
        let cost = vec![std::u64::MAX; size];
        let heap = (0..size).collect::<Vec<_>>();
        BinHeap { cost: cost, heap: heap.clone(), index: heap }
    }

    fn set_lower_cost(&mut self, n: usize, c: u64) {
        self.cost[n] = c;
        let ni = self.index[n];
        if ni < self.heap.len() {
            self.upheap(ni);
        }
    }

    fn pop(&mut self) -> Option<usize> {
        if self.heap.len() < 2 {
            self.heap.pop()
        } else {
            let last = self.heap.len() - 1;
            self.heap.swap(0, last);
            self.index.swap(self.heap[0], self.heap[last]);
            let root = self.heap.pop();
            self.downheap(0);
            root
        }
    }

    fn upheap(&mut self, mut ni: usize) {
        let n = self.heap[ni];
        while ni > 0 {
            let pi = (ni - 1) / 2;
            if self.cost[self.heap[pi]] <= self.cost[n] {
                break;
            }
            self.index.swap(n, self.heap[pi]);
            self.heap.swap(ni, pi);
            ni = pi;
        }
    }

    fn downheap(&mut self, mut ni: usize) {
        let n = self.heap[ni];
        while self.heap.len() > ni * 2 + 1 {
            let (li, ri) = (ni * 2 + 1, ni * 2 + 2);
            let ci = if self.heap.len() <= ri ||
                self.cost[self.heap[li]] < self.cost[self.heap[ri]] {
                    li
                } else {
                    ri
                };
            if self.cost[n] <= self.cost[self.heap[ci]] {
                break;
            }
            self.index.swap(n, self.heap[ci]);
            self.heap.swap(ni, ci);
            ni = ci;
        }
    }
}

trait Gets { fn gets(&mut self) -> String; }
impl<T: std::io::BufRead> Gets for T {
    fn gets(&mut self) -> String { self.lines().next().unwrap().unwrap() } }


Measured memory_bytes: 36604