Asymptotic properties of multistate random walks. I. Theory