It sounds very difficult but I think it actually is quite simple.
For a sequence of ternary digits (ie., use symbols 0, 1 and 2), you have the freedom to choose the first digit as you like, but for all the other digits, you can only choose the 2 alternatives you have.