The tower of n-groupoids and the long cohomology sequence