// template {{{

#include <bits/stdc++.h>
using namespace std;

#define loop(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) loop(i, 0, n)
#define rloop(i, a, b) for (int i = (int)(b) - 1; i >= (int)(a); i--)
#define rrep(i, n) rloop(i, 0, n)
#define pb push_back
#define pf push_front
#define eb emplace_back
#define ef emplace_front
#define mp std::make_pair
#define mt std::make_tuple
#define fi first
#define se second

using ll = long long;
using ull = unsigned long long;

template<typename T, size_t H, size_t W>
using matrix = std::array<std::array<T, W>, H>;

const int MOD = 1e9 + 7;
const int INF = 1e9 + 10;
const ll LLINF = 1e18 + 10;

const int dx[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int dy[] = {0, -1, 0, 1, -1, 1, -1, 1};

template<typename T>
inline T sq(T x){ return x * x; }

template<typename T, typename U>
inline void chmax(T &x, U y){ x = std::max<T>(x, y); }

template<typename T, typename U>
inline void chmin(T &x, U y){ x = std::min<T>(x, y); }

template<typename T>
inline void sort(T &c){ std::sort(std::begin(c), std::end(c)); }

template<typename T>
inline void reverse(T &c){ std::reverse(std::begin(c), std::end(c)); }

template<typename T>
inline void unique(T &c){ std::sort(c); c.erase(std::unique(std::begin(c), std::end(c))); }

// }}}

using tp3 = tuple<int, int, int>;
using tp4 = tuple<int, int, int, int>;

int N, M, H, K;
int a[1000], b[1000], c[1000], h[1000], r[1000];
int S, T;
int P;
int dp[256];
int dp2[25][100][256];

int main()
{
	while (cin >> N >> M >> H >> K, N){
		rep(i, M){
			cin >> a[i] >> b[i] >> c[i] >> h[i] >> r[i], a[i]--, b[i]--, r[i]--;
			a[i + M] = b[i]; b[i + M] = a[i]; c[i + M] = c[i];
			h[i + M] = h[i]; r[i + M] = r[i];
		}
		M *= 2;
		cin >> S >> T >> P, S--, T--;
		fill_n(dp, 256, INF);
		dp[0] = 0;
		rep(i, P){
			int l, d, k, b = 0;
			cin >> l >> d;
			rep(j, l){
				cin >> k, k--;
				b |= 1 << k;
			}
			rep(j, 256) chmin(dp[j | b], dp[j] + d);
		}
		rep(i, 256) rep(j, 256) chmin(dp[i], dp[i | j]);
		
		fill_n(**dp2, 25 * 100 * 256, INF);
		dp2[0][S][0] = 0;
		rep(i, H) rep(j, 256) rep(k, M){
			if (i + h[k] > H) continue;
			chmin(dp2[i + h[k]][b[k]][j], dp2[i][a[k]][j] + c[k]);
			chmin(dp2[i + h[k]][b[k]][j | (1 << r[k])], dp2[i][a[k]][j]);
		}

		int res = INF;
		rep(i, H + 1) rep(j, 256) chmin(res, dp[j] + dp2[i][T][j]);
		cout << (res >= INF ? -1 : res) << endl;
	}
}