When we go to the next suffix, we see that the longest common prefix of

the suffix with the previous one Is empty, we know that from the array.

And so, the only common part of the path from root to the new leaf and

to the previous leaf is the root note.

So we don't need to create any new nodes, other than the leaf node for

the new suffix, and we create an edge from root directly to this new node.

And we write down the corresponding suffix on this edge.

When we go to the next suffix however,

there is already a common prefix of length one, which is a, so

we'll need to create a new node in the middle of this last created edge.

And we'll divide it into edges with letter a and with letter $.

And this is what happens.

So now we have a new node which is connected with letter a to the root and

from which, there are two outgoing edges, one with the letter $,

and another with string a$, corresponding to the last considered suffix.

Now when we consider the next suffix,

the longest common prefix with the previous one is again just a.

So we don't need to create a new node other than the leaf node.

So we create a leaf node for the new suffix abaa$ and

we connect it with the yellow node which corresponds to the longest

common suffix prefix with the previous suffix, with an edge where we write baa$,

everything that is left in the suffix.