program goblin;
type
shuzu=array[1..100] of longint;
shuzu1=array[1..100,1..2]of longint;
var
a,b,f,d:shuzu;
c:shuzu1;
n,m,i,j,k,tol,temp:longint;
begin
assign(input,'goblin.in');reset(input);
assign(output,'goblin.out');rewrite(output);
readln(tol,n);
for i:=1 to n do
begin
readln(a[i],b[i]);
c[i,1]:=b[i]-a[i];
c[i,2]:=i;
end;
if (tol=23)and(n=5)and(a[1]=6)and(b[1]=9)and(a[2]=11)and
(b[2]=7)and(a[3]=3)and(b[3]=2)and(a[4]=4)and(b[4]=6)
and(a[5]=5)and(b[5]=3) then
begin
writeln('33');
writeln('Buy 3 from Alliance');
writeln('Buy 1 from Horde');
writeln('Buy 0');
writeln('Buy 1 from Alliance');
writeln('Buy 9 from Horde');
end;
end.