{$APPTYPE CONSOLE}
Uses
  SysUtils, Math;
var
  n, i, s, t, r, c1, c2, c3 : longint;
  d, z : array [0..50] of longint;

Begin
  Reset(Input, 'railway.in');
  Rewrite(Output, 'railway.out');
  Read(n);
  assert((1 <= n) and (n <= 50));
  d[0] := 0;
  for i := 1 to n do begin
    Read(d[i]);
    assert((0 < d[i]) and (d[i] <= 1000));
    if (i > 1) then
      assert(d[i - 1] < d[i]);
  end;
  z[0] := 0;
  for i := 1 to n do begin
    Read(z[i]);
    if (i = 1) then
      assert(z[i] = 1)
    else
      assert((z[i] = z[i - 1]) or (z[i] = z[i - 1] + 1));
  end;
  Read(s, t);
  assert((0 <= s) and (s <= n));
  assert((0 <= t) and (t <= n));
  assert(s <> t);
  read(c1, c2, c3, r);
  assert((1 <= c1) and (c1 <= 1000));
  assert((1 <= c2) and (c2 <= 1000));
  assert((1 <= c3) and (c3 <= 1000));
  assert((1 <= r) and (r <= 1000));
  writeln(max(c1, c1 * abs(z[s] - z[t])));
  if (abs(d[s] - d[t]) < r) then
    writeln(abs(d[s] - d[t]) * c2)
  else
    writeln(abs(d[s] - d[t]) * c3);
  Close(Input);
  Close(Output);
End.
