Easy:
In the first step your output is essentially 3 numbers:
The algorithm demands that you specify a sliding window up front. That means you know how big (1) and (2) can be at most. In other words, you know how many bits (1) and (2) will take up. Since (3) is essentially also a character from a fixed length alphabet, you also know the bit-length of (3)
That means it's safe to simply concatenate them. So, the output of the first algorithm can be thought of as outputting a bit-sequence, where every item in the sequence has a fixed length.
That's ideal for applying huffman.
Of course the specifics are not mentioned, and you can choose from a lot of options.
So I can not readily explain the exact output values you are showing. But I hope I can at least explain how to get from A to B.