# ural 1031. Railway Tickets | poj 2355

！！！可能总共用一张票就够了

// ural 1031. Railway Tickets
// wa wa wa wa ac 0.406s
#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

#define FOR(i,a,b) for(i = (a); i < (b); ++i)
#define FORE(i,a,b) for(i = (a); i <= (b); ++i)
#define FORDE(i,a,b) for(i = (a); i >= (b); --i)

int n, m;
int l1, l2, l3, c1, c2, c3;
int st, ed;
long long dp[10010], l[10010], val[10010];

void input() {
int i;

scanf("%d %d %d %d %d %d", &l1, &l2, &l3, &c1, &c2, &c3);
scanf("%d", &n);
scanf("%d %d", &st, &ed);
if(st > ed)
swap(st, ed);
FORE(i, 1, n - 1)
scanf("%lld", &l[i]);
FORDE(i, n - 1, 1)
l[i] = l[i] - l[i - 1];
}

long long get_val(long long x) {
if(x <= l1)
return c1;
if(x <= l2)
return c2;
return c3;
}

void solve() {
int i, j;

FORE(i, 1, n - 1) {
if(l[i] <= l1)
val[i] = c1;
else if(l[i] <= l2)
val[i] = c2;
else
val[i] = c3;
}
FORE(i, st, ed - 1) {
dp[i] = dp[i - 1] + val[i];
j = i - 1;
long long sum_val = l[i];
// !!!
while(j >= st - 1 && sum_val <= l3) {
dp[i] = min(dp[i], dp[j] + get_val(sum_val));
sum_val += l[j];
--j;
}
}
printf("%lld\n", dp[ed - 1]);
}

int main() {
input();
solve();
return 0;
}