function seq=step_sequence(cur,l,m,n);

if (l>=1)&(l<=n),
	if m>1,
		sub_seq=[step_sequence([],l-1,m-1,n);step_sequence([],l,m-1,n);step_sequence([],l+1,m-1,n)];
		seq=[cur;l(ones(1,size(sub_seq,1)),1) sub_seq];
	else
		seq=l;
	end
else
	seq=[];
end
