graph g;int n,m,p,s,t,u[2d5],v[2d5],a[3d5],b[3d5],y,z[1d5];{rd(n,m,p,s,t,(u,v)(m));rep(i,m)u[m+i]=u[i]+n,v[m+i]=v[i],v[i]+=n;g.setEdge(2n+1,2m,u,v);g.getDist(s,a);g.getDist(t+p%2*n,b);rep(j,1,n+1)z[y]=j,y+=1u*a[j]-1.+1u*b[j]