#include <cmath>
#include <queue>
#include <type_traits>
#include <cstddef>
#include <limits>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
namespace loquat {
using vertex_t = size_t;
}
namespace loquat {
namespace edge_param {
struct to_ {
	vertex_t to;
	explicit to_(vertex_t t = 0)
		: to(t)
	{ }
};
template <typename T>
struct weight_ {
	using weight_type = T;
	weight_type weight;
	explicit weight_(const weight_type& w = weight_type())
		: weight(w)
	{ }
};
template <typename T>
using weight = weight_<T>;
}
namespace detail {
template <typename T, typename... Params>
struct edge_param_wrapper : public T, edge_param_wrapper<Params...> {
	template <typename U, typename... Args>
	explicit edge_param_wrapper(U&& x, Args&&... args)
		: T(std::forward<U>(x))
		, edge_param_wrapper<Params...>(std::forward<Args>(args)...)
	{ }
};
template <typename T>
struct edge_param_wrapper<T> : public T {
	template <typename U>
	explicit edge_param_wrapper(U&& x)
		: T(std::forward<U>(x))
	{ }
};
}
template <typename... Params>
struct edge : public detail::edge_param_wrapper<edge_param::to_, Params...> {
	template <typename... Args>
	explicit edge(Args&&... args)
		: detail::edge_param_wrapper<edge_param::to_, Params...>(
			std::forward<Args>(args)...)
	{ }
};
}
namespace loquat {
template <typename EdgeType>
class adjacency_list {
public:
	using edge_type = EdgeType;
	using edge_list = std::vector<edge_type>;
private:
	std::vector<std::vector<EdgeType>> m_edges;
public:
	explicit adjacency_list(size_t n)
		: m_edges(n)
	{ }
	size_t size() const {
		return m_edges.size();
	}
	const edge_list& operator[](vertex_t u) const {
		return m_edges[u];
	}
	template <typename... Args>
	void add_edge(vertex_t from, Args&&... args){
		m_edges[from].emplace_back(std::forward<Args>(args)...);
	}
};
}
namespace loquat {
template <typename T>
constexpr inline auto positive_infinity() noexcept
	-> typename std::enable_if<std::is_integral<T>::value, T>::type
{
	return std::numeric_limits<T>::max();
}
}
namespace loquat {
template <typename EdgeType>
std::vector<typename EdgeType::weight_type>
sssp_dijkstra(vertex_t source, const adjacency_list<EdgeType>& graph){
	using weight_type = typename EdgeType::weight_type;
	using pair_type = std::pair<weight_type, vertex_t>;
	using queue_type = std::priority_queue<
		pair_type, std::vector<pair_type>, std::greater<pair_type>>;
	const auto inf = positive_infinity<weight_type>();
	const auto n = graph.size();
	std::vector<weight_type> result(n, inf);
	queue_type pq;
	result[source] = 0;
	pq.emplace(0, source);
	while(!pq.empty()){
		const auto x = pq.top().first;
		const auto u = pq.top().second;
		pq.pop();
		if(result[u] < x){ continue; }
		for(const auto& e : graph[u]){
			const auto v = e.to;
			const auto y = x + e.weight;
			if(y < result[v]){
				result[v] = y;
				pq.emplace(y, v);
			}
		}
	}
	return result;
}
}
using namespace std;
using ll = long long;
using edge = loquat::edge<loquat::edge_param::weight<ll>>;
static const ll INF = 1000000000000000000ll;
int main(){
	ios_base::sync_with_stdio(false);
	int n, m, s, t;
	cin >> n >> m >> s >> t;
	--s; --t;
	loquat::adjacency_list<edge> ga(n);
	loquat::adjacency_list<edge> gb(n);
	for(int i = 0; i < m; ++i){
		int u, v, a, b;
		cin >> u >> v >> a >> b;
		--u; --v;
		ga.add_edge(u, v, a);
		ga.add_edge(v, u, a);
		gb.add_edge(u, v, b);
		gb.add_edge(v, u, b);
	}
	const auto fwd_a = loquat::sssp_dijkstra(s, ga);
	const auto bwd_b = loquat::sssp_dijkstra(t, gb);
	vector<ll> solution(n, INF);
	for(int i = 0; i < n; ++i){
		solution[i] = fwd_a[i] + bwd_b[i];
	}
	for(int i = n - 1; i > 0; --i){
		solution[i - 1] = min(solution[i - 1], solution[i]);
	}
	for(int i = 0; i < n; ++i){
		cout << 1000000000000000 - solution[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 19016