d['@@'];a,b,c,j,k;f(v){d[j]>d[++k]+v?d[j]=d[k]+v:0;}main(n,p){scanf("%d%d",&n,&p);for(memset(d+p+1,99,12);j++