This is interesting, though I am 3 weeks late.
Raku code: https://glot.io/snippets/gonclpwl3p
@seaker