#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
long long int head[120000],m,n,s,t,x;
long long int dist[120][12];
long long int vis[120000];
typedef struct{
long long int u,v,w,next;
}Node;
Node edge[120000];
void SPFA(){
queue<long long int>q;
q.push(s);
vis[s] = 1;
while(!q.empty()){
int u = q.front();
q.pop();
vis[u] = 0;
long long int w,v;
for(int i = head[u]; i > 0; i = edge[i].next){
v = edge[i].v;
w = edge[i].w;
for(int j = 0; j < x; j++){
if(dist[u][j] < dist[u][11] && dist[v][(j+1)%x] > dist[u][j] + w){ //用dist[u][11]与主函数中dist[n+1][0]用法一致
dist[v][(j+1)%x] = dist[u][j] + w;
if(!vis[v]){
vis[v] = 1;
q.push(v);
}
}
}
}
}
}
int main(){
int T;
scanf("%d",&T);
while(T--){
scanf("%lld%lld",&n,&m);
memset(head,0,sizeof(head));
memset(dist,INF,sizeof(dist));
memset(vis,0,sizeof(vis));
for(int i = 1; i <= m; i++){
long long int u,v,w;
scanf("%lld%lld%lld",&u,&v,&w);
edge[i] = Node{u,v,w,head[u]}; //利用前向星来存边和权值
head[u] = i;
}
scanf("%lld%lld%lld",&s,&t,&x);
dist[s][0] = 0;
SPFA();
//cout << INF << endl;
if(dist[t][0] == dist[n+1][0])printf("No Answer!\n"); //用dist[n+1][0]而不用INF,是因为数组中的INF值与只输出INF时的值不一致 你可以输出cout << INF来验证!
else printf("%lld\n",dist[t][0]);
}
return 0;
}