import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

class Node{
	long cost;
	long[Node] adjcost;
	int id;
	bool isVisited;
	
	this(int id){
		this.id = id;
		}
	}


void main(){
	int n = read.to!int;
	int m = read.to!int;
	int s = read.to!int - 1;
	int t = read.to!int - 1;
	
	Node[] nodes_yen;
	foreach(i; 0 .. n) nodes_yen ~= new Node(i);
	
	Node[] nodes_snuuk;
	foreach(i; 0 .. n) nodes_snuuk ~= new Node(i);
	
	foreach(i; 0 .. m){
		int u = read.to!int - 1;
		int v = read.to!int - 1;
		long a = read.to!long;
		long b = read.to!long;
		
		nodes_yen[u].adjcost[nodes_yen[v]] = a;
		nodes_yen[v].adjcost[nodes_yen[u]] = a;
		nodes_snuuk[u].adjcost[nodes_snuuk[v]] = b;
		nodes_snuuk[v].adjcost[nodes_snuuk[u]] = b;
		}
	
	auto rbt_yen = redBlackTree!("a.cost<b.cost", Node)();
	
	Node nds = nodes_yen[s];
	nds.isVisited = true;
	rbt_yen.insert(nds);
	foreach(nd; nds.adjcost.keys){
		if(!nd.isVisited){
			nd.cost = nds.cost + nds.adjcost[nd];
			rbt_yen.insert(nd);
			}
		}
	
	while(rbt_yen.length){
		Node nd = rbt_yen.front;
		rbt_yen.removeFront;
		if(nd.isVisited) continue;
		nd.isVisited = 1;
		foreach(nd2; nd.adjcost.keys){
			if(!nd2.isVisited){
				nd2.cost = nd.cost + nd.adjcost[nd2];
				rbt_yen.insert(nd2);
				}
			}
		}
	
	debug foreach(nd; nodes_yen) nd.cost.writeln;
	
	
	auto rbt_snuuk = redBlackTree!("a.cost<b.cost", Node)();
	
	Node ndt = nodes_snuuk[t];
	ndt.isVisited = true;
	rbt_snuuk.insert(ndt);
	foreach(nd; ndt.adjcost.keys){
		if(!nd.isVisited){
			nd.cost = ndt.cost + ndt.adjcost[nd];
			rbt_snuuk.insert(nd);
			}
		}
	
	while(rbt_snuuk.length){
		Node nd = rbt_snuuk.front;
		rbt_snuuk.removeFront;
		if(nd.isVisited) continue;
		nd.isVisited = 1;
		foreach(nd2; nd.adjcost.keys){
			if(!nd2.isVisited){
				nd2.cost = nd.cost + nd.adjcost[nd2];
				rbt_snuuk.insert(nd2);
				}
			}
		}
	
	debug foreach(nd; nodes_snuuk) nd.cost.writeln;
	
	long[] answers;
	long bestcost = 1_000_000_000_000_000;
	for(int i = n - 1; i >= 0; i --){
		
		long cost;
		if(i == n - 1){
			cost = nodes_yen[n - 1].cost + nodes_snuuk[n - 1].cost;
			if(cost < bestcost) bestcost = cost;
			}
		else{
			long tempcost = nodes_yen[i].cost + nodes_snuuk[i].cost;
			if(tempcost < bestcost){
				cost = tempcost;
				bestcost = cost;
				}
			else{
				cost = bestcost;
				}
			}
		answers ~= 1_000_000_000_000_000 - cost;
		}
	
	foreach_reverse(ans; answers) ans.writeln;
	
	
	
	}