const
  maxn=100;
  inputfile='subtract.in';
  outputfile='subtract.out';
var
  min,max,num,op:array[1..maxn+1]of integer;
  n,t:integer;
procedure init;
  var i:integer;
  begin
    assign(input,inputfile);
    reset(input);
    read(n,t);
    for i:=1 to n do read(num[i]);
    close(input);
    max[n+1]:=0;
    min[n+1]:=0;
    for i:=n downto 1 do begin
      max[i]:=abs(num[i])+max[i+1];
      min[i]:=-max[i];
    end;
  end;
procedure print(first,order:byte);
  var i:byte;
  begin
    if first=n-1
       then writeln(order)
       else if op[first+1]<0
               then begin
                      writeln(order);
                      print(first+1,order);
                    end
               else begin
                      for i:=first+1 to n-1 do op[i]:=-op[i];
                      print(first+1,order+1);
                      writeln(order);
                    end;
  end;
procedure run(lev:byte;sum:integer);
  begin
    if lev=n then begin
       print(1,1);
       close(output);
       halt;
    end;
    if (sum+num[lev+1]+max[lev+2]>=t) and (sum+num[lev+1]+min[lev+2]<=t) then
    begin
      op[lev]:=1;
      run(lev+1,sum+num[lev+1]);
    end;
    if (sum-num[lev+1]+max[lev+2]>=t) and (sum-num[lev+1]+min[lev+2]<=t) then
    begin
      op[lev]:=-1;
      run(lev+1,sum-num[lev+1]);
    end;
  end;
begin
  init;
  op[1]:=-1;
  assign(output,outputfile);
  rewrite(output);
  run(2,num[1]-num[2]);
end.
