#include <cstdio>
#include <algorithm>
using namespace std;

double dp[101][101][11][11][5];
int stb[16], s[101];
int L, A, B;

/*
prv
	0: 左トン
	1: 右トン
	2: 左コツ
	3: 右コツ
	4: none
*/
double dfs(int len, int scr, int cmb, int prc, int prv){
	cmb = min(cmb, 10);
	scr = min(scr, 100);

	double &ret = dp[len][scr][cmb][prc][prv];
	if(ret < 0.0){
		if(scr >= 100){
			ret = 1.0;
		}
		else if(len == L){
			ret = 0.0;
		}
		else if(s[len] == 0){
			ret = dfs(len + 1, scr, cmb, 10, 4);
		}
		else if(prv == 4){
			ret = dfs(len + 1, scr, 0, 10, 4);
			for(int k = -2; k <= -1; ++k){
				ret = max(ret, dfs(len + 1, scr + A + B * cmb, cmb + 1, 10, s[len] * 2 + k));
			}
		}
		else{
			ret = dfs(len + 1, scr, 0, 10, 4);
			for(int k = -2; k <= -1; ++k){
				int nxt = s[len] * 2 + k;
				int npc = max(0, stb[prv * 4 + nxt] - 10 + prc);
				double ps = dfs(len + 1, scr + A + B * cmb, cmb + 1, npc, nxt);
				double pf = dfs(len + 1, scr, 0, npc, nxt);
				ret = max(ret, 0.1 * (npc * ps + (10 - npc) * pf));
			}
		}
	}

	return ret;
}


int main(){
	while(1){
		for(int i = 0; i < 16; ++i){
			if(scanf("%d", &stb[i]) != 1){ return 0; }
		}
		scanf("%d", &L);
		for(int i = 0; i < L; ++i){
			scanf("%d", &s[i]);
		}
		scanf("%d%d", &A, &B);
		A /= 100;
		B /= 100;

		fill(****dp, ****dp + sizeof(dp) / sizeof(double), -1.0);

		printf("%f\n", dfs(0, 0, 0, 10, 4));
	}
}