Spin confinement in the superlattices of graphene ribbons