#[allow(unused_imports)]
use std::cmp::{Ordering};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};

#[allow(unused_imports)]
use std::iter::FromIterator;

#[allow(unused_macros)]
macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::min($x, min!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::max($x, max!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! get { 
    ([$t: ty]) => { 
        { 
            let mut line = String::new(); 
            stdin().read_line(&mut line).unwrap(); 
            line.split_whitespace().map(|t|t.parse::<$t>().unwrap()).collect::<Vec<_>>()
        }
    };
    ([$t: ty];$n: expr) => {
        (0..$n).map(|_|get!([$t])).collect::<Vec<_>>()
    };
    ($t: ty) => {
        {
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t: ty),*) => {
        { 
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap(),)*)
        }
    };
    ($t: ty; $n: expr) => {
        (0..$n).map(|_|get!($t)).collect::<Vec<_>>()
    };
    ($($t: ty),*; $n: expr) => {
        (0..$n).map(|_|get!($($t),*)).collect::<Vec<_>>()
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

const BIG_STACK_SIZE: bool = true;

#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}

#[derive(Eq, PartialEq, Clone, Debug)]
pub struct Rev<T>(pub T);
impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<Ordering> {
        other.0.partial_cmp(&self.0)
    }
}
impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> Ordering {
        other.0.cmp(&self.0)
    }
}

fn solve() {
    let (n,m,s,t) = get!(usize, usize, usize, usize);
    let uvab = get!(usize, usize, usize, usize;m);

    let mut nodes = vec![Vec::new(); n+1];
    for (u,v,a,b) in uvab {
        nodes[u].push((v,a,b));
        nodes[v].push((u,a,b));
    }

    const INF: usize = 1_000_000_000_000_000;
    let mut yen_dist = vec![INF; n+1];
    let mut heap = BinaryHeap::new();
    yen_dist[s] = 0;
    heap.push(Rev((0,s)));
    while let Some(Rev((cost, node))) = heap.pop() {
        for &(next, yen, _) in &nodes[node] {
            if yen_dist[next] > cost+yen {
                yen_dist[next] = cost+yen;
                heap.push(Rev((yen_dist[next], next)));
            }
        }
    }

    let mut snuuk_dist = vec![INF; n+1];
    let mut heap = BinaryHeap::new();
    snuuk_dist[t] = 0;
    heap.push(Rev((0,t)));
    while let Some(Rev((cost, node))) = heap.pop() {
        for &(next, _, snuuk) in &nodes[node] {
            if snuuk_dist[next] > cost+snuuk {
                snuuk_dist[next] = cost+snuuk;
                heap.push(Rev((snuuk_dist[next], next)));
            }
        }
    }

    let mut costs = BinaryHeap::new();
    for i in 1..n+1 {
        let cost = yen_dist[i]+snuuk_dist[i];
        costs.push(Rev((cost, i)));
    }
    let mut cost = 0;
    let mut node = 0;

    for i in 0..n {
        while node <= i {
            let Rev((n_cost, n_node)) = costs.pop().unwrap();
            cost = n_cost;
            node = n_node;
        }
        println!("{}", INF-cost);
    }
}


Measured memory_bytes: 30584