There is a sequence of numbers $+1$ and $-1$ of length $n$. It is known that the sum of every $10$ neighboring numbers in the sequence is $0$, and that the sum of every $12$ neighboring numbers in the sequence is not zero. What is the maximal value of $n$?

Let's think step by step and output the final answer within \boxed{}.
user