How to solve the following two system of matrix equations:
$A^2B+ABA+BA^2=0$ and $B^2A+BAB+AB^2=0$ simultaneously for non-singular matrix $A\in M_n(\mathbb{Z})$ and for some nilpotent matrix $B\in M_n(\mathbb{Z})$.
I am trying to find some examples for some $n=2,3,4,\ldots,$ but could not write a sage code for this that gives an example.