I don't claim any of this is optimal or even works on anything other than my input
Not the set theoretic kind