program drugi;
var
n,a,ost,st,i:integer;
p,z:array[1..100]of integer;
begin
readln(n,a);
st:= 0;
if n < 3*a then writeln(-1)
else st:= 3;
if st <> 0 then
begin
p[1]:= a;
p[2]:= a;
p[3]:= a;
if n > 6 * (a - 1) then
begin
z[1]:= a-2;
z[2]:= a-2;
z[3]:= a-2;
ost:= n - 6 * (a - 1);
if (ost mod 2) = 1 then
begin
z[2]:= z[2] - 1;
ost:= ost - 1;
p[1]:= p[1] + 1;
z[1]:= z[1] + 1;
end;
p[1]:= p[1] + ost div 2;
z[1]:= z[1] + ost div 2;
end
else
begin
ost:= n - 3 * a;
if ost > a - 2 then
begin
z[2]:= a - 2;
ost:= ost - (a - 2);
end;
if (ost mod 2) = 1 then
begin
z[2]:= z[2] + 1;
ost:= ost - 1;
end;
p[1]:= p[1] + ost div 2;
z[1]:= z[1] + ost div 2;
end;
for i:= 1 to 3 do
writeln(p[i], ' ', z[i]);
end;
end.