#include using namespace std; typedef long long ll; typedef pair pll; int main(){ ll inf=1000000000000000000; ll n,m,l;cin>>n>>m>>l; l--; ll t[n];for(ll i=0;i>t[i]; vector v[n]; ll cost[n][n]; for(ll i=0;i>a>>b>>c; a--;b--; v[a].push_back(b); v[b].push_back(a); cost[a][b]=c; cost[b][a]=c; } for(ll i=0;i,greater >q; q.push(make_pair((ll)0,i)); d[i][i]=0; bool used[n];fill(used,used+n,false); while(q.size()>0){ pll p=q.top();q.pop(); ll pf=p.first,ps=p.second; //cout<pf+cost[ps][now]){ d[i][now]=pf+cost[ps][now]; q.push(make_pair(d[i][now],now)); } } } } ll ans=inf; for(ll i=0;i