Var i:longint;
    n,w,m,s,x,y,r:int64;
    ans:array[0..100333]of int64;
 procedure hal;
   begin
     writeln(-1);
     halt(0);
   end;
  begin
    assign(input,'story.in');
    reset(input);
    assign(output,'story.out');
    rewrite(output);
    read(n, m, s, r);
    if (s < 0) then hal;
    if (n - 1 > m) then hal;
    if ((n - 1) * r < s) then hal;
    if (m > (n*(n - 1) div 2)) then hal;
    if (s < n - 1) then hal;
    w := s div (n - 1);
    for i:=2 to n do
      ans[i] := w;
    for i:=2 to s mod (n - 1) + 1 do
      ans[i] := ans[i] + 1;
    for i:=2 to n do
      Writeln(1,' ',i,' ',ans[i]);
    x:=2;
    y:=3;
    for i := n to m do
      begin
        Writeln(x,' ',y,' ',r);
        inc(y);
        if y > n then
          begin
            inc(x);
            y:=x+1;
          end;
      end;
    close(input);
    close(output);
  end.
