#include <bits/stdc++.h>
#define sll(n) scanf("%lld",&(n))
#define sll2(m,n) scanf("%lld%lld",&(m),&(n))
#define sll3(m,n,o) scanf("%lld%lld%lld",&(m),&(n),&(o))
#define sll4(m,n,o,p) scanf("%lld%lld%lld%lld",&(m),&(n),&(o),&(p))
#define pll(n) printf("%lld ",(n))
#define plln(n) printf("%lld\n",(n))
#define ps(s) printf("%s",(c_str(s)))
#define psn(s) printf("%s\n",(c_str(s)))
#define nln printf("\n")
#define cln cout<<"\n"
#define clr(dp,x) memset(dp,x,sizeof(dp))
#define pb push_back
#define mp make_pair
#define s(a) sort(a.begin(),a.end())
#define sa(a,n) sort(a,a+(n))
#define vecll vector<long long int>
#define vecs vector<string>
#define vecpll vector<pair<long long int,long long int> >
#define pii pair <long long int , long long int >
#define plpl pair <long long int , pair <long long int , long long int > >
#define ppll pair < pair <long long int , long long int > , long long int >
#define pplpl pair < pair <long long int , long long int >, pair <long long int , long long int > >
//#define rep(i, begin, end) for (__typeof(end) i = (begin); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define rep(i,a,n) for(__typeof(n) i=a;i<n;++i)
#define repr(i,b,a) for(__typeof(b) i=b;i>=a;--i)
#define rep1(it,v) for(auto &it:(v))
#define all(c) (c).begin(),(c).end()
#define fast_IO ios_base::sync_with_stdio(false);cin.tie(0);
#define while_tc int64_t t;sll(t);while(t--)
#define adjlw vector<vecpll > /// ( connected to , weight ) - adjlw adj(MAXN)
#define adjl vecll ///connected to - adjl adj[MAXN]
#define ispow2(n) (n&&(!(n&(n-1)))) ///check if its perfect power of 2
#define ff first
#define ss second
#define gcd(a,b) __gcd(a,b)
#define bit(mask) __builtin_popcount(mask)
#define lsb(x) __builtin_ffl(x)-1
typedef int64_t ll;
ll INF=1000000000;
ll MOD=1000000007;
ll MOD2 = MOD*MOD;
double pi=2*acos(0.0);
typedef unsigned long long int ull; /// specifier - llu
using namespace std;
inline ll expo(ll e, ll n){ll x=1,p=e;while(n){if(n&1)x=x*p;p=p*p;n>>=1;}return x;}
inline ll power(ll e, ll n, ll m){ll x=1,p=e;while(n){if(n&1)x=(x*p)%m;p=(p*p)%m;n>>=1;}return x;}
inline ll InverseEuler(ll a, ll m){return (a==1? 1 : power(a, m-2, m));}
inline ll lcm(ll a, ll b){return (a*(b/gcd(a,b)));}
inline ll InverseEuclid(ll a, ll m){ll m0=m,t,q,x0=0,x1=1;if(m==1)return 0;while (a>1){q=a/m;t=m;m=a%m;a=t;t=x0;x0=x1-q*x0;x1=t;}return(x1<0?x1+m0:x1);}
//inline ll CRT(){ll M=1,ans=0;rep(i,0,n)M*=num[i];rep(i,0,n)ans=(ans%M+(rem[i]%M*(M/num[i])*(InverseEuclid(M/num[i],num[i]))%M)%M)%M;return ans;}
ll movex8[]={-1,-1,-1,0,0,1,1,1};
ll movey8[]={-1,0,1,-1,1,-1,0,1};
ll movex4[]={1,-1,0,0};
ll movey4[]={0,0,1,-1};
vector <pair <ll, pair <double, double> > >v[101]; /// to, wt
vecll path(101, -1), restore;
ll s, t, n, m, x, y;
double r, d = 0, ans = 0;
vector <double> dist(101, INF+0.0);
inline bool dijkstra(double temp, bool ha)
{
priority_queue <pair <double, ll> > q;
while (!q.empty())
q.pop();
rep(i, 0, n+1)
{
dist[i] = INF + 0.0;
path[i] = -1;
}
dist[s] = 0;
q.push(mp(0,s));
while (!q.empty())
{
ll from = q.top().ss;
double len = -q.top().ff; /// path length upto q.front.ss;
q.pop();
if (len > dist[from]) /// dist[from] may have been modified to lesser value than previously queued len
continue;
for (auto &it : v[from])
{
ll to = it.ff;
double t1 = it.ss.ff;
double wt = it.ss.ss;
if ((dist[from] + wt < dist[to]) && (t1 <= temp))
{
dist[to] = dist[from] + wt;
path[to] = from;
q.push(mp( -dist[to], to));
}
}
}
if (ha)
{
restore.clear();
for (ll x1 = t; x1!=s ; x1 = path[x1])
restore.pb(x1);
restore.pb(s);
}
if (dist[t] >= INF || dist[t]<0)
return false;
else
return true;
}
int main()
{
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
//fast_IO
while(sll2(n, m)!=EOF)
{
double l=0, h=0;
sll2(s, t);
rep(i, 0, n+1)
v[i].clear();
rep(i, 0, m)
{
scanf("%lld%lld%lf%lf", &x, &y, &r, &d);
v[x].pb(mp(y, mp(r, d)));
v[y].pb(mp(x, mp(r, d)));
h=max(h, r);
}
h+=1.0;
while(l<=h)
{
double mid = ((l+h)/2.0);
if (dijkstra(mid, false))
{
ans = mid;
h = mid - 0.01;
}
else
l = mid + 0.01;
}
ll p = ans*10;
ans = p/10 + (0.1)*(p%10);
dijkstra(ans, true);
reverse(all(restore));
rep(i, 0, restore.size()-1)
pll(restore[i]);
printf("%lld\n", restore[restore.size()-1]);
printf("%0.1lf %0.1lf\n", dist[t], ans);
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgc2xsKG4pIHNjYW5mKCIlbGxkIiwmKG4pKQojZGVmaW5lIHNsbDIobSxuKSBzY2FuZigiJWxsZCVsbGQiLCYobSksJihuKSkKI2RlZmluZSBzbGwzKG0sbixvKSBzY2FuZigiJWxsZCVsbGQlbGxkIiwmKG0pLCYobiksJihvKSkKI2RlZmluZSBzbGw0KG0sbixvLHApIHNjYW5mKCIlbGxkJWxsZCVsbGQlbGxkIiwmKG0pLCYobiksJihvKSwmKHApKQojZGVmaW5lIHBsbChuKSBwcmludGYoIiVsbGQgIiwobikpCiNkZWZpbmUgcGxsbihuKSBwcmludGYoIiVsbGRcbiIsKG4pKQojZGVmaW5lIHBzKHMpIHByaW50ZigiJXMiLChjX3N0cihzKSkpCiNkZWZpbmUgcHNuKHMpIHByaW50ZigiJXNcbiIsKGNfc3RyKHMpKSkKI2RlZmluZSBubG4gcHJpbnRmKCJcbiIpCiNkZWZpbmUgY2xuIGNvdXQ8PCJcbiIKI2RlZmluZSBjbHIoZHAseCkgbWVtc2V0KGRwLHgsc2l6ZW9mKGRwKSkKI2RlZmluZSBwYiBwdXNoX2JhY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bGw+ID4gcTsKICAgIHdoaWxlICghcS5lbXB0eSgpKQogICAgICAgIHEucG9wKCk7CiAgICByZXAoaSwgMCwgbisxKQogICAgewogICAgICAgIGRpc3RbaV0gPSBJTkYgKyAwLjA7CiAgICAgICAgcGF0aFtpXSA9IC0xOwogICAgfQogICAgZGlzdFtzXSA9IDA7CiAgICBxLnB1c2gobXAoMCxzKSk7CiAgICB3aGlsZSAoIXEuZW1wdHkoKSkKICAgIHsKICAgICAgICBsbCBmcm9tID0gcS50b3AoKS5zczsKICAgICAgICBkb3VibGUgbGVuID0gLXEudG9wKCkuZmY7ICAgLy8vIHBhdGggbGVuZ3RoIHVwdG8gcS5mcm9udC5zczsKICAgICAgICBxLnBvcCgpOwoKICAgICAgICBpZiAobGVuID4gZGlzdFtmcm9tXSkgICAgIC8vLyBkaXN0W2Zyb21dIG1heSBoYXZlIGJlZW4gbW9kaWZpZWQgdG8gbGVzc2VyIHZhbHVlIHRoYW4gcHJldmlvdXNseSBxdWV1ZWQgbGVuCiAgICAgICAgICAgIGNvbnRpbnVlOwoKICAgICAgICBmb3IgKGF1dG8gJml0IDogdltmcm9tXSkKICAgICAgICB7CgogICAgICAgICAgICBsbCB0byA9IGl0LmZmOwogICAgICAgICAgICBkb3VibGUgdDEgPSBpdC5zcy5mZjsKICAgICAgICAgICAgZG91YmxlIHd0ID0gaXQuc3Muc3M7CgogICAgICAgICAgICBpZiAoKGRpc3RbZnJvbV0gKyAgd3QgPCBkaXN0W3RvXSkgJiYgKHQxIDw9IHRlbXApKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBkaXN0W3RvXSA9IGRpc3RbZnJvbV0gKyB3dDsKICAgICAgICAgICAgICAgIHBhdGhbdG9dID0gZnJvbTsKICAgICAgICAgICAgICAgIHEucHVzaChtcCggLWRpc3RbdG9dLCB0bykpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgaWYgKGhhKQogICAgewogICAgICAgIHJlc3RvcmUuY2xlYXIoKTsKICAgICAgICBmb3IgKGxsIHgxID0gdDsgeDEhPXMgOyB4MSA9IHBhdGhbeDFdKQogICAgICAgICAgICByZXN0b3JlLnBiKHgxKTsKICAgICAgICByZXN0b3JlLnBiKHMpOwogICAgfQogICAgaWYgKGRpc3RbdF0gPj0gSU5GIHx8IGRpc3RbdF08MCkKICAgICAgICByZXR1cm4gZmFsc2U7CiAgICBlbHNlCiAgICAgICAgcmV0dXJuIHRydWU7Cn0KCgoKaW50IG1haW4oKQp7CiAgICAvL2ZyZW9wZW4oImlucHV0LnR4dCIsInIiLHN0ZGluKTsKCS8vZnJlb3Blbigib3V0cHV0LnR4dCIsInciLHN0ZG91dCk7CgkvL2Zhc3RfSU8KCXdoaWxlKHNsbDIobiwgbSkhPUVPRikKCXsKCSAgICBkb3VibGUgbD0wLCBoPTA7CgkgICAgc2xsMihzLCB0KTsKCSAgICByZXAoaSwgMCwgbisxKQogICAgICAgICAgICB2W2ldLmNsZWFyKCk7CgkgICAgcmVwKGksIDAsIG0pCgkgICAgewoJICAgICAgICBzY2FuZigiJWxsZCVsbGQlbGYlbGYiLCAmeCwgJnksICZyLCAmZCk7CgkgICAgICAgIHZbeF0ucGIobXAoeSwgbXAociwgZCkpKTsKCSAgICAgICAgdlt5XS5wYihtcCh4LCBtcChyLCBkKSkpOwoJICAgICAgICBoPW1heChoLCByKTsKCSAgICB9CgkgICAgaCs9MS4wOwoJICAgIHdoaWxlKGw8PWgpCiAgICAgICAgewogICAgICAgICAgICBkb3VibGUgbWlkID0gKChsK2gpLzIuMCk7CiAgICAgICAgICAgIGlmIChkaWprc3RyYShtaWQsIGZhbHNlKSkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgYW5zID0gbWlkOwogICAgICAgICAgICAgICAgaCA9IG1pZCAtIDAuMDE7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgbCA9IG1pZCArIDAuMDE7CiAgICAgICAgfQogICAgICAgIGxsIHAgPSBhbnMqMTA7CiAgICAgICAgYW5zID0gcC8xMCArICgwLjEpKihwJTEwKTsKICAgICAgICBkaWprc3RyYShhbnMsIHRydWUpOwogICAgICAgIHJldmVyc2UoYWxsKHJlc3RvcmUpKTsKICAgICAgICByZXAoaSwgMCwgcmVzdG9yZS5zaXplKCktMSkKICAgICAgICAgICAgcGxsKHJlc3RvcmVbaV0pOwogICAgICAgIHByaW50ZigiJWxsZFxuIiwgcmVzdG9yZVtyZXN0b3JlLnNpemUoKS0xXSk7CiAgICAgICAgcHJpbnRmKCIlMC4xbGYgJTAuMWxmXG4iLCBkaXN0W3RdLCBhbnMpOwoJfQoJcmV0dXJuIDA7Cn0K