use std::cmp::{ min, max };
use std::collections::{ BinaryHeap, VecDeque };

struct GraphDijkstra {
    edges: Vec<Vec<(usize, i64)>>, // adjacent list
    n: usize
}

impl GraphDijkstra {
    fn new(n: usize) -> Self {
        GraphDijkstra {
            edges: vec![Vec::new(); n],
            n: n
        }
    }

    fn add_costs(&mut self, from: usize, to: usize, cost: i64, directed: bool) {
        if directed {
            self.edges[from].push((to, cost));
        } else {
            self.edges[from].push((to, cost));
            self.edges[to].push((from, cost));
        }

    }

    fn dijkstra_search(&self, start: usize, inf: i64) -> Vec<i64> {
        let mut dist: Vec<i64> = vec![inf; self.n];
        let mut visited: Vec<bool> = vec![false; self.n];
        dist[start] = 0;
        let mut que: BinaryHeap<(i64, usize)> = BinaryHeap::new();
        que.push((0, start));
        while let Some((_, v)) = que.pop() {
            if visited[v] {
                continue
            }
            visited[v] = true;
            for edge in &self.edges[v] {
                let (u, cost) = *edge;
                if visited[u] {
                    continue
                }
                if dist[u] > dist[v] + cost {
                    dist[u] = dist[v] + cost;
                    que.push(( -dist[u], u));
                }
            }
        }
        return dist
    }
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
    n: usize,
    m: usize,
    s: usize,
    t: usize,
    xs: [(usize, usize, i64, i64); m],
    }
    let mut graph_a = GraphDijkstra::new(n);
    let mut graph_b = GraphDijkstra::new(n);
    // 以下の入力、for の中でやるとうまくいかないらしい
    // 入力は先に終わらせて、グラフにaddする
    for i in 0..m {
        let u = xs[i].0;
        let v = xs[i].1;
        let a = xs[i].2;
        let b = xs[i].3;
        graph_a.add_costs(u-1, v-1, a, false);
        graph_b.add_costs(u-1, v-1, b, false);
    }

    let inf: i64 = 1 << 61;
    let result_a = graph_a.dijkstra_search(s-1, inf);
    let result_b = graph_b.dijkstra_search(t-1, inf);
    let mut ans_list: Vec<i64> = vec![inf; n];
    for i in 0..n {
        ans_list[i] = 1_000_000_000_000_000 - (result_a[i] + result_b[i]);
    }
    for i in (0..n-1).rev() {
        ans_list[i] = max(ans_list[i], ans_list[i+1]);
    }
    for ans in ans_list {
        println!("{}", ans)
    }
}


Measured memory_bytes: 36604