I came across the following question:
A source $X$ emits symbols from the alphabet $A_x$ with $|A_x| = 8$. We want to construct a preﬁx-free source code for this source.
We want to ﬁnd a code with codeword lengths $(1,3,3,3,5,5,5,5)$. Can such a code exist? If yes, give such a code. If not, prove that.
I checked Kraft's inequality for the given set of lengths and it's fulfilled. So how can we write such a code?