using namespace std
inline int read(){//快读
int x=0,w=1
while(c<'0'||c>'9'){if(c=='-')w=-1
while(c>'0'&&c<'9')x=(x<<3)+(x<<1)+c-'0',c=getchar()
return x*w
}
struct Edge{
int v,w,nxt
}e[500010]
int head[10010],cnt=0
inline void addedge(int u, int v, int w){
e[++cnt].v=v
e[cnt].w=w
e[cnt].nxt=head[u]
//nxt记录的是同起点的之前一条边的cnt值,cnt唯一标识一条边
head[u]=cnt
}
int n,m,s
int dis[100010]
struct node{
int u,d
bool operator<(const node&rhs) const{
//固定格式 用地址进行操作rhs代表第二个
return d>rhs.d
}
inline void Dijkstra(){
for(re int i=0
dis[s]=0
priority_queue<node> Q
Q.push ((node){s,0})
while(!Q.empty()){
node fr=Q.top()
int u=fr.u,d=fr.d
if(d!=dis[u]) continue
for(re int i=head[u]
int v=e[i].v,w=e[i].w
if(dis[u]+w<dis[v]){
dis[v]=dis[u]+w
Q.push((node){v,dis[v]})
}
}
}
}
int main(){
n=read(),m=read(),s=read()
for(re int i=1
int x=read(),y=read(),z=read()
addedge(x,y,z)
}
Dijkstra()
for(re int i=1
return 0
}