How can I create same-height boxes (with rounded corners and background color) around triples of letters in math mode?

I tried $ T = \boxed{ban}\boxed{ana}\boxed{ban}\boxed{$$$} $ but it also results in differents heights.

As reference, please see following image I saw in slides by Sebastian Wild in slide 30 in <https://www.wild-inter.net/teaching/comp526/notes-06-text-indexing.pdf> . I would to all of these boxes to have the same height.

[![Array with letters in irregular-heighted boxes ](https://i.stack.imgur.com/MGxoA.png)](https://i.stack.imgur.com/MGxoA.png)