#[derive(Copy, Clone, Eq, PartialEq)]
struct State {
    cost: usize,
    position: usize,
}

impl Ord for State {
    fn cmp(&self, other: &State) -> std::cmp::Ordering {
        other.cost.cmp(&self.cost)
    }
}

impl PartialOrd for State {
    fn partial_cmp(&self, other: &State) -> Option<std::cmp::Ordering> {
        Some(self.cmp(other))
    }
}

#[derive(Debug, Copy, Clone)]
struct Edge {
    to: usize,
    yen: usize,
    snook: usize,
}

fn shortest_path_yen(adjl: &Vec<Vec<Edge>>, start: usize) -> Vec<usize> {
    let mut dist: Vec<_> = (0..adjl.len()).map(|_| std::usize::MAX).collect();

    let mut heap = std::collections::BinaryHeap::new();

    dist[start] = 0;
    heap.push(State {
        cost: 0,
        position: start,
    });

    while let Some(State { cost, position }) = heap.pop() {
        if cost > dist[position] {
            continue;
        }

        for edge in &adjl[position] {
            let next = State {
                cost: cost + edge.yen,
                position: edge.to,
            };
            if next.cost < dist[next.position] {
                heap.push(next);
                dist[next.position] = next.cost;
            }
        }
    }
    dist
}
fn shortest_path_snook(adjl: &Vec<Vec<Edge>>, start: usize) -> Vec<usize> {
    let mut dist: Vec<_> = (0..adjl.len()).map(|_| std::usize::MAX).collect();

    let mut heap = std::collections::BinaryHeap::new();

    dist[start] = 0;
    heap.push(State {
        cost: 0,
        position: start,
    });

    while let Some(State { cost, position }) = heap.pop() {
        if cost > dist[position] {
            continue;
        }

        for edge in &adjl[position] {
            let next = State {
                cost: cost + edge.snook,
                position: edge.to,
            };
            if next.cost < dist[next.position] {
                heap.push(next);
                dist[next.position] = next.cost;
            }
        }
    }
    dist
}

fn main() {
    let (v, e, start, terminal): (usize, usize, usize, usize) =
        (read(), read(), read::<usize>() - 1, read::<usize>() - 1);
    let mut adjl: Vec<Vec<Edge>> = vec![vec![]; v];
    for _ in 0..e {
        let (u, v, yen, snook): (usize, usize, usize, usize) =
            (read::<usize>() - 1, read::<usize>() - 1, read(), read());
        adjl[u].push(Edge {
            to: v,
            yen: yen,
            snook: snook,
        });
        adjl[v].push(Edge {
            to: u,
            yen: yen,
            snook: snook,
        });
    }
    let yd = shortest_path_yen(&adjl, start);
    let sd = shortest_path_snook(&adjl, terminal);
    let mut tmpcost = std::usize::MAX;
    let mut costs = vec![];
    for i in (0..v).rev() {
        tmpcost = min(tmpcost, yd[i] + sd[i]);
        costs.push(tmpcost);
    }
    let m = 10usize.pow(15);
    for i in 0..v {
        println!("{}", m - costs[v - i - 1]);
    }
}

// =========
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::process::exit;

#[allow(dead_code)]
const MOD: usize = 1000000007;

fn read<T: std::str::FromStr>() -> T {
    use std::io::Read;
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

// =========


Measured memory_bytes: 24316