#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
#define dump(X) cout << #X << ' ' << X << endl
#define pe(X) cout << X << endl
#define pb push_back
#define INF 1000000000
#define sec second
#define fi first
int dp[1<<11];
int N,M,H,K;
int S,T;
int Pn;
int pS[500],pcost[500];

struct edge{
	int to,cost,company;
	edge(){}
	edge(int to,int cost,int company):to(to),cost(cost),company(company){}
};
vector<edge> g[100100];
int d[100100];
int encode(int pos,int t){
	return 100*pos+t;
}
int rec(int Sb){
	if(dp[Sb]!=INF)return dp[Sb];
	for(int i=0;i<Pn;i++){
		if((pS[i]&Sb)!=pS[i])continue;
		int res = Sb-pS[i];
		for(int T=0;T<(1<<K);T++){
			if((res&T)!=res)continue;
			if((Sb&T)!=T)continue;
			if(Sb == T) continue;
			dp[Sb]=min(dp[Sb],pcost[i]+rec(T));
		}
	}
	return dp[Sb];
}

int dijkstra(int pas_S){
	for(int i=0;i<100100;i++)d[i]=INF;
	int s = encode(S,0);
	d[s]=0;
	priority_queue<P,vector<P>,greater<P> > q;
	q.push(P(d[s],s));
	while(!q.empty()){
		int v = q.top().sec;
		int dv = q.top().fi;
		q.pop();
		if(d[v]<dv)continue;
		for(int i=0;i<g[v].size();i++){
			edge e = g[v][i];
			int cost = e.cost;
			if((pas_S>>e.company)&1){ // free
				cost = 0;
			}
			if(d[e.to]>d[v]+cost){
				d[e.to]=d[v]+cost;
				q.push(P(d[e.to],e.to));
			}
		}
	}
	int res = INF;
	for(int i=0;i<=H;i++){
		res = min(res,d[encode(T,i)]);
	}
	return res;
}
bool solve(){
	cin >> N >> M >> H >> K;
	if(N+M+H+K==0)return false;
	for(int i=0;i<100100;i++)g[i].clear();
	for(int i=0;i<M;i++){
		int a,b,c,h,r;
		cin >> a >> b >> c >> h >> r;
		a--;b--;
		r--;
		for(int i=0;i<H;i++){
			int v,u;
			v = encode(a,i);
			u = encode(b,i+h);
			g[v].pb(edge(u,c,r));
			//printf("%d %d %d %d\n",v,u,c,r); 
			
			v = encode(b,i);
			u = encode(a,i+h);
			g[v].pb(edge(u,c,r));
			//printf("%d %d %d %d\n",u,v,c,r);
		}
	}
	cin >> S >> T;
	S--;T--;
	cin >> Pn;
	for(int i=0;i<Pn;i++){
		int l;
		cin >> l >> pcost[i];
		pS[i]=0;
		for(int j=0;j<l;j++){
			int tmp;
			cin >> tmp;
			tmp--;
			pS[i] |= (1<<tmp);
		} 
	}

	// dp part
	for(int i=0;i<(1<<K);i++){
		dp[i]=INF;
	}
	dp[0]=0;
	for(int i=0;i<(1<<K);i++){
		rec(i);
	}
	/*for(int i=0;i<(1<<K);i++){
		cout << "a" << dp[i] << endl;
	}*/
	int ans = INF;
	for(int i=0;i<(1<<K);i++){
		//cout << i << ' '<< dijkstra(i) << endl;
		ans = min(ans,dijkstra(i)+dp[i]);
	}
	if(ans==INF)cout << -1 << endl;
	else cout << ans << endl;
	return true;
}
int main(){
	while(solve()){}
	return 0;
}
