{DEFINE DEBUG}
{$DEFINE DMI}
{DEFINE DO0}
{$IFDEF DEBUG}
{$B-,I+,N+,O-,Q+,R+,S+}
{$ELSE}
{$B-,I-,N+,O+,Q-,R-,S-}
{$ENDIF}
{$APPTYPE CONSOLE}
Program JurySol;
uses SysUtils;
const TaskName = 'stations';
 MinN = 1; MaxN = 100; MinR = 0; MaxR = 1000; MinL = 1; MaxL = 20000;
 MinD = 1; MaxD = 10000;
 MaxC = $3F3F3F3F;
var i, j, k, l, lbig, m, n, r, rbig, lb1, lb2, hb1, hb2: Integer;
 a: array [1..MaxL] of Integer;
 b, c, f: array [0..MaxL] of Integer;

BEGIN
 reset (input, TaskName + '.in');
 rewrite (output, TaskName + '.out');
{$IFDEF DMI} repeat {$ENDIF}
 assert (NOT seekeoln);
 read (n);
 assert ((n >= MinN) AND (n <= MaxN));
 assert (NOT seekeoln);
 read (l);
 assert ((l >= MinN) AND (l <= MaxN));
 assert (NOT seekeoln);
 read (lbig);
 assert ((lbig >= MinL) AND (lbig <= MaxL));
 assert (seekeoln);
 readln;

 assert (NOT seekeoln);
 read (r);
 assert ((r >= MinR) AND (r <= MaxR));
 assert (NOT seekeoln);
 read (rbig);
 assert ((r <= rbig) AND (rbig >= MinR) AND (rbig <= MaxR));
 assert (seekeoln);
 readln;

 for i := 1 to lbig do begin
  assert (NOT seekeoln);
  read (a[i]);
  assert ((a[i] >= MinD) AND (a[i] <= MaxD));
 end;
 assert (seekeoln);
 readln;

 b[0] := 0;
 for i := 1 to lbig do
  b[i] := b[i - 1] + a[i];

 for i := 0 to lbig - l do
  c[i] := b[i + l] - b[i];

 fillchar (f, sizeof (f), 63);
 for i := r to rbig do f[i] := 0;
 for i := 1 to n do begin
  lb1 := (l + r) * i + r;
  if lb1 > lbig then
   lb1 := lbig;
  hb1 := (l + rbig) * i + rbig;
  if hb1 > lbig then
   hb1 := lbig;
  for m := hb1 downto lb1 do begin
   f[m] := MaxC;
   lb2 := m - l - rbig;
   if lb2 < 0 then
    lb2 := 0;
   hb2 := m - l - r;
   for j := lb2 to hb2 do begin
    k := f[j] + c[j];
    if f[m] > k then
     f[m] := k;
   end;
  end;
  for m := lb1 - 1 downto 0 do
   f[m] := MaxC;
{$IFDEF DO0}
  writeln (lb1, ' ', hb1);
  for j := 0 to lbig do write (f[j]:12); writeln;
{$ENDIF}
 end;

 if (f[lbig] = MaxC) then writeln ('No solution.')
                     else writeln (f[lbig]);
{$IFDEF DMI} until seekeof; {$ENDIF}
 assert (seekeof);
END.
