solution for the inverse's matrix