Let $B$ be a subset of $\mathbb{Z}_{3}^{n}$ with the property that for every two distinct members $(a_{1},\ldots,a_{n})$ and $(b_{1},\ldots,b_{n})$ of $B$ there exist $1\leq i\leq n$ such that $a_{i}\equiv{b_{i}+1}\pmod{3}$. Prove that $|B| \leq 2^{n}$.
Problem
Source: Iranian National Olympiad (3rd Round) 2006
Tags: modular arithmetic, vector, function, linear algebra, combinatorics proposed, combinatorics