#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
inline T intceil(T a, T b) {
  return (a + (b - 1)) / b;
}
const long long MOD = 1e9 + 7;
template <typename T>
void printv(vector<T>& v) {
  int n = v.size() - 1;
  for (int i = 0; i < n; ++i) cout << v[i] << " ";
  cout << v.back() << endl;
}
const string alphabet = "abcdefghijklmnopqrstuvwxyz";
const int dy[4] = {0, 1, 0, -1};
const int dx[4] = {1, 0, -1, 0};
static const long double pi = acos(-1.0);
struct Graph {
  struct Edge {
    int to;
    long long weight;
    Edge(int t, long long w) : to(t), weight(w) {}
  };
  using Dist = vector<long long>;
  vector<vector<Edge>> edges;
  int n;
  Graph(int initN) {
    n = initN;
    edges = vector<vector<Edge>>(n);
  }
  void insertDirectedEdge(int from, int to, long long weight) {
    edges[from].push_back(Edge(to, weight));
  }
  void insertUndirectedEdge(int a, int b, long long weight) {
    edges[a].push_back(Edge(b, weight));
    edges[b].push_back(Edge(a, weight));
  }
  Dist dijkstra(int s) {
    Dist dist(n, -1);
    priority_queue<pair<long long, long long>,
                   vector<pair<long long, long long>>,
                   greater<pair<long long, long long>>>
        pq;
    dist[s] = 0;
    pq.push(pair<long long, long long>(0, s));
    while (!pq.empty()) {
      pair<long long, long long> cur = pq.top();
      pq.pop();
      if (dist[cur.second] < cur.first) continue;
      for (auto& nextEdge : edges[cur.second]) {
        long long nextCost = cur.first + nextEdge.weight;
        if (dist[nextEdge.to] == -1 || dist[nextEdge.to] > nextCost) {
          dist[nextEdge.to] = nextCost;
          pq.push(pair<long long, long long>(nextCost, nextEdge.to));
        }
      }
    }
    return dist;
  }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M, S, T;
  cin >> N >> M >> S >> T;
  --S, --T;
  Graph yenG(N), snuukG(N);
  for (int i = 0; i < M; ++i) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    --a, --b;
    yenG.insertUndirectedEdge(a, b, c);
    snuukG.insertUndirectedEdge(a, b, d);
  }
  auto yenDist = yenG.dijkstra(S);
  auto snuukDist = snuukG.dijkstra(T);
  vector<long long> ans(N);
  ans[N - 1] = yenDist[N - 1] + snuukDist[N - 1];
  for (int i = N - 2; i >= 0; --i) {
    ans[i] = min(ans[i + 1], yenDist[i] + snuukDist[i]);
  }
  for (auto& a : ans) {
    cout << (long long)1e15 - a << endl;
    ;
  }
}
