{$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, h: array [1..MaxL] of Integer;
 b, c, f, g: array [0..MaxL] of Integer;

procedure minheapup (i: Integer);
var j, x: Integer;
begin
 x := h[i];
 repeat
  j := i shr 1;
  if (j = 0) OR (f[h[j]] + c[h[j]] <= f[x] + c[x]) then break;
  h[i] := h[j]; g[h[i]] := i; i := j;
 until False;
 h[i] := x; g[x] := i;
end;

procedure minheapdown (i: Integer);
var j, x: Integer;
begin
 x := h[i];
 repeat
  j := i shl 1;
  if j > k then break;
  if (j < k) AND (f[h[j + 1]] + c[h[j + 1]] < f[h[j]] + c[h[j]]) then inc (j);
  if f[h[j]] + c[h[j]] >= f[x] + c[x] then break;
  h[i] := h[j]; g[h[i]] := i; i := j;
 until False;
 h[i] := x; g[x] := i;
end;

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 (eoln);
 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 (eoln);
 readln;

 for i := 1 to lbig do begin
  assert (NOT seekeoln);
  read (a[i]);
  assert ((a[i] >= MinD) AND (a[i] <= MaxD));
 end;
 assert (eoln and not eof);
 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;
{$IFDEF DO0}
 for j := 0 to lbig do write (f[j]:12); writeln;
{$ENDIF}
 for i := 1 to n do begin
  lb1 := (l + r) * i + r; if lb1 > lbig then lb1 := lbig + 1;
  hb1 := (l + rbig) * i + rbig; if hb1 > lbig then hb1 := lbig;
  lb2 := hb1 - l - rbig; if lb2 < 0 then lb2 := 0;
  hb2 := hb1 - l - r;
  k := 0;
  for m := hb2 downto lb2 do begin
   inc (k);
   h[k] := m;
   g[m] := k;
   minheapup (k);
  end;
  for m := hb1 downto lb1 do begin
   assert (k > 0);
   f[m] := f[h[1]] + c[h[1]];
   j := g[hb2];
   dec (hb2);
   h[j] := h[k];
   dec (k);
   minheapdown (j);
   minheapup (j);
{
   for j := 2 to k do
    if (f[h[j shr 1]] + c[h[j shr 1]] > f[h[j]] + c[h[j]]) then begin
     writeln (k:10, j shr 1:10, h[j shr 1]:10,
      f[h[j shr 1]] + c[h[j shr 1]]:12, j:10, h[j]:10, f[h[j]] + c[h[j]]:12);
     assert (f[h[j shr 1]] + c[h[j shr 1]] <= f[h[j]] + c[h[j]]);
    end;
}
   if lb2 > 0 then begin
    dec (lb2);
    inc (k);
    h[k] := lb2;
    g[lb2] := k;
    minheapup (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 (eof);
END.
